From walter.weinmann@REDACTED Mon May 1 04:40:25 2017 From: walter.weinmann@REDACTED (Walter Weinmann) Date: Mon, 1 May 2017 04:40:25 +0200 Subject: [erlang-questions] tnsparse (Oracle tnsnames.ora file parser) Version 1.0.0 Message-ID: tnsparse is a production-ready Oracle tnsnames.ora file parser written in pure Erlang. tnsparse is closely aligned to the the official Oracle documentation (Oracle? Database Net Services Reference 12c Release 2 (12.2)) and in future will be adapted on a regular basis as the Oracle database software evolves. Regards Walter -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon May 1 09:41:15 2017 From: donpedrothird@REDACTED (John Doe) Date: Mon, 1 May 2017 10:41:15 +0300 Subject: [erlang-questions] Mnesia crash on startup Message-ID: Hi everyone, from time to time I'm getting mnesia crash on startup of the app. Another restart fixes the problem. What could be the reason of this error? 2017-05-01 07:19:50.964 [error] <0.296.0> Mnesia('theapp@REDACTED'): ** ERROR ** (core dumped to file: "/opt/theapp/MnesiaCore.bos stds@REDACTED") ** FATAL ** mnesia_monitor crashed: {timeout,{gen_server,call,[application_controller,which_applications]}} state: {state,<0.298.0>,[],[],true, [],undefined,[],[]} 2017-05-01 07:20:00.965 [error] <0.296.0> Mnesia('theapp@REDACTED'): ** ERROR ** mnesia_event got unexpected event: {'EXIT',<0.300. 0>,killed} 2017-05-01 07:20:00.966 [error] <0.296.0> CRASH REPORT Process mnesia_event with 0 neighbours exited with reason: killed in gen_event:terminate_ server/4 line 310 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Mon May 1 10:01:15 2017 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 01 May 2017 08:01:15 +0000 Subject: [erlang-questions] Mnesia crash on startup In-Reply-To: References: Message-ID: Should be an error message before that? Otherwise could email me (privatly) or upload that MnesiaCore file somewhere where I can take a look at it. /Dan On Mon, May 1, 2017 at 9:41 AM John Doe wrote: > Hi everyone, > from time to time I'm getting mnesia crash on startup of the app. Another > restart fixes the problem. What could be the reason of this error? > > 2017-05-01 07:19:50.964 [error] <0.296.0> > Mnesia('theapp@REDACTED'): ** ERROR ** (core dumped to file: > "/opt/theapp/MnesiaCore.bos > stds@REDACTED") > ** FATAL ** mnesia_monitor crashed: > {timeout,{gen_server,call,[application_controller,which_applications]}} > state: {state,<0.298.0>,[],[],true, > [],undefined,[],[]} > 2017-05-01 07:20:00.965 [error] <0.296.0> > Mnesia('theapp@REDACTED'): ** ERROR ** mnesia_event got > unexpected event: {'EXIT',<0.300. > 0>,killed} > 2017-05-01 07:20:00.966 [error] <0.296.0> CRASH REPORT Process > mnesia_event with 0 neighbours exited with reason: killed in > gen_event:terminate_ > server/4 line 310 > > _______________________________________________ > 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 May 1 23:44:35 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 2 May 2017 09:44:35 +1200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <20170428122848.GB79301@erix.ericsson.se> References: <20170424100109.GA52860@erix.ericsson.se> <20170425141404.GA26809@erix.ericsson.se> <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> Message-ID: > On 29/04/2017, at 12:28 AM, Raimo Niskanen wrote: > > It is difficult to reliably detect the other direction i.e in the driver > when you get an address from e.g getsockname(); is it an empty string or an > abstract address? Surely an empty string would never have been legal, so if the first byte is NUL and the host supports abstract addresses, it must be an abstract address? From arunp@REDACTED Tue May 2 09:17:56 2017 From: arunp@REDACTED (Arun) Date: Tue, 2 May 2017 12:47:56 +0530 Subject: [erlang-questions] erlang start up log Message-ID: <590832A4.8060909@utl.in> Hi, If I type erl on terminal I am getting a start up log as shown below *12:42:09* ~$ erl Erlang/OTP 17 [erts-6.3] [source-f9282c6] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.3 (abort with ^G) 1> Can somebody explain me, *[smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] *what are these informations indicate.? And how to cross verify whether the symmetric multiprocessing(SMP) is enabled or not.? Regards, Arun P -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Tue May 2 09:20:38 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Tue, 2 May 2017 09:20:38 +0200 Subject: [erlang-questions] erlang start up log In-Reply-To: <590832A4.8060909@utl.in> References: <590832A4.8060909@utl.in> Message-ID: smp = symmetric multiprocessing, 4:4 = 4 cores, 4 schedulers started one per core. Yes SMP is strong in this one async-threads 10 = for IO offloading, increase this number with command line options if your program does a lot of disk IO and you notice underperformance. hipe = native compiler backend and JIT kernel-poll = more efficient socket interface, if your program does a lot of networking, you might consider setting +K as command line option 2017-05-02 9:17 GMT+02:00 Arun : > Hi, > > If I type erl on terminal I am getting a start up log as shown below > > *12:42:09* ~$ erl > Erlang/OTP 17 [erts-6.3] [source-f9282c6] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.3 (abort with ^G) > 1> > > Can somebody explain me, *[smp:4:4] [async-threads:10] [hipe] > [kernel-poll:false] *what are these informations indicate.? And how to > cross verify whether the symmetric multiprocessing(SMP) is enabled or not.? > > Regards, > Arun P > > _______________________________________________ > 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 Tue May 2 12:57:51 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 May 2017 13:57:51 +0300 Subject: [erlang-questions] gen_server init returns {stop, Reason} and fails: possibly doc bug? Message-ID: Here: http://erlang.org/doc/man/gen_server.html#start_link-3 we can read that start_link will return {error, Reason} if init callback returns {stop, Reason} Maybe I'm wrong, but it seems that it is not possible to get back clean reply, because gen_server.erl has following code: proc_lib:init_ack(Starter, {error, Reason}), % here we may receive error tuple exit(Reason) After exit caller is failing because of linkage. So if we want to have start_link, we cannot get clean logs and clearly get {error, Reason} tuple. Am I wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Tue May 2 13:33:45 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 2 May 2017 13:33:45 +0200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: References: <20170425141404.GA26809@erix.ericsson.se> <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> Message-ID: <20170502113345.GA47815@erix.ericsson.se> On Tue, May 02, 2017 at 09:44:35AM +1200, Richard A. O'Keefe wrote: > > > On 29/04/2017, at 12:28 AM, Raimo Niskanen wrote: > > > > It is difficult to reliably detect the other direction i.e in the driver > > when you get an address from e.g getsockname(); is it an empty string or an > > abstract address? > > Surely an empty string would never have been legal, > so if the first byte is NUL and the host supports abstract > addresses, it must be an abstract address? > If the first byte is NUL and the length is larger than 0 then it must be an abstract address. But when this comes from above (from Erlang) and since we do not know if the host supports abstract addresses; if we give the kernel a first byte NUL but address length longer than SUN_LEN(su), will then we cause harm on some OS? I will assume not and rewrite the code, soonish... -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From abhishek@REDACTED Tue May 2 13:57:39 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Tue, 2 May 2017 17:27:39 +0530 (IST) Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux Message-ID: <288502270.56136.1493726259674@webmail.blacklightsw.com> Hi, I am a beginner in erlang and probably it is quite a naive question but I am new to both erlang and linux os as well. I an using Amazon AWS linux instance. I was installing ejabberd in the linux instance through source code when I came to know that I had to install erlang first so I ran command yum install erlang and the system installed erlang R14B ,then I found that it was needed that i install erlang/otp 17.1 for this. So now I am a bit confused how to uninstall previous version of erlang first and then install a specific version of erlang i.e. Erlang/OTP 17.1 on Amazon AWS linux instance. Thanks in advance. Regards, Abhishek -------------- next part -------------- An HTML attachment was scrubbed... URL: From grahamrhay@REDACTED Tue May 2 14:34:16 2017 From: grahamrhay@REDACTED (Graham Hay) Date: Tue, 2 May 2017 13:34:16 +0100 Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <288502270.56136.1493726259674@webmail.blacklightsw.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: Erlang Solutions provide pre-built binaries of newer versions: https://packages.erlang-solutions.com/erlang/ Or you can build it yourself (using e.g kerl). -------------- next part -------------- An HTML attachment was scrubbed... URL: From himars@REDACTED Tue May 2 14:41:17 2017 From: himars@REDACTED (Jack Tang) Date: Tue, 2 May 2017 20:41:17 +0800 Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <288502270.56136.1493726259674@webmail.blacklightsw.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: You can install and manage different erlang version by kerl ( https://github.com/kerl/kerl) On Tue, May 2, 2017 at 7:57 PM, Abhishek Ranjan wrote: > Hi, > > I am a beginner in erlang and probably it is quite a naive question but I > am new to both erlang and linux os as well. I an using Amazon AWS linux > instance. I was installing ejabberd in the linux instance through source > code when I came to know that I had to install erlang first so I ran > command > > yum install erlang > > and the system installed erlang R14B ,then I found that it was needed that > i install erlang/otp 17.1 for this. > > So now I am a bit confused how to uninstall previous version of erlang > first and then install a specific version of erlang i.e. Erlang/OTP 17.1 on > Amazon AWS linux instance. > > Thanks in advance. > > Regards, > > Abhishek > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Jack Tang http://www.linkedin.com/in/jacktang -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Tue May 2 14:43:06 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Tue, 2 May 2017 18:13:06 +0530 (IST) Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: <1890330242.60537.1493728986421@webmail.blacklightsw.com> But aren't these binaries for windows os and i am looking to install a specific version of erlang (17.1) in linux instance that actually runs like fedora Regards Abhishek > On May 2, 2017 at 6:04 PM Graham Hay wrote: > > Erlang Solutions provide pre-built binaries of newer versions: > > https://packages.erlang-solutions.com/erlang/ > > Or you can build it yourself (using e.g kerl). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From uniaika@REDACTED Tue May 2 14:09:08 2017 From: uniaika@REDACTED (Hecate) Date: Tue, 2 May 2017 14:09:08 +0200 Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <288502270.56136.1493726259674@webmail.blacklightsw.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: My advice for that would be to use Kerl ? https://github.com/kerl/kerl I use it along with Kiex (for Elixir) and it just works?. Have a good day! Le 02/05/2017 ? 13:57, Abhishek Ranjan a ?crit : > Hi, > > I am a beginner in erlang and probably it is quite a naive question but > I am new to both erlang and linux os as well. I an using Amazon AWS > linux instance. I was installing ejabberd in the linux instance through > source code when I came to know that I had to install erlang first so I > ran command > > |yum install erlang | > > and the system installed erlang R14B ,then I found that it was needed > that i install erlang/otp 17.1 for this. > > So now I am a bit confused how to uninstall previous version of erlang > first and then install a specific version of erlang i.e. Erlang/OTP 17.1 > on Amazon AWS linux instance. > > Thanks in advance. > > Regards, > > Abhishek > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From solvip@REDACTED Tue May 2 14:18:23 2017 From: solvip@REDACTED (=?UTF-8?B?U8O2bHZpIFDDoWxsIMOBc2dlaXJzc29u?=) Date: Tue, 2 May 2017 12:18:23 +0000 Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <288502270.56136.1493726259674@webmail.blacklightsw.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: Hi I tend to use the Erlang Solutions RPMs. You can find them at https://www.erlang-solutions.com/resources/download.html Cheers S?lvi On Tue, May 2, 2017 at 11:57 AM, Abhishek Ranjan wrote: > Hi, > > I am a beginner in erlang and probably it is quite a naive question but I am > new to both erlang and linux os as well. I an using Amazon AWS linux > instance. I was installing ejabberd in the linux instance through source > code when I came to know that I had to install erlang first so I ran command > > yum install erlang > > and the system installed erlang R14B ,then I found that it was needed that i > install erlang/otp 17.1 for this. > > So now I am a bit confused how to uninstall previous version of erlang first > and then install a specific version of erlang i.e. Erlang/OTP 17.1 on Amazon > AWS linux instance. > > Thanks in advance. > > Regards, > > Abhishek > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From abhishek@REDACTED Tue May 2 15:17:37 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Tue, 2 May 2017 18:47:37 +0530 (IST) Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <7C1CA6A8-8DEA-401F-BF22-AD4186C6031F@att.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> <1890330242.60537.1493728986421@webmail.blacklightsw.com> <7C1CA6A8-8DEA-401F-BF22-AD4186C6031F@att.com> Message-ID: <868123133.63476.1493731057829@webmail.blacklightsw.com> Yes @GrahamHay already pointed that to me. Thank you for reply anyway. Regards Abhishek > On May 2, 2017 at 6:44 PM "HODGSON, GARRY" wrote: > > > Why would you think that? They have tabs for Ubuntu, centos, osx, debian, windows, fedora, and raspbian. > > > > From: on behalf of Abhishek Ranjan > Reply-To: Abhishek Ranjan > Date: Tuesday, May 2, 2017 at 8:43 AM > To: Graham Hay > Cc: Erlang Questions > Subject: Re: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux > > > > But aren't these binaries for windows os and i am looking to install a specific version of erlang (17.1) in linux instance that actually runs like fedora > > Regards > Abhishek > > > > > > > > On May 2, 2017 at 6:04 PM Graham Hay wrote: > > > > Erlang Solutions provide pre-built binaries of newer versions: > > > > > > > > https://packages.erlang-solutions.com/erlang/ https://urldefense.proofpoint.com/v2/url?u=https-3A__packages.erlang-2Dsolutions.com_erlang_&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=ts1EGC4agXUFnoSF_gOr3w&m=mgHVTtbHJ-VzpYsGl361eKCIOEjoug1tSeStHY26hLc&s=gHZ53US5k0URWfgb6uoEAHiDfrGdTaVJw8iqriXx_1Q&e= > > > > > > > > Or you can build it yourself (using e.g kerl). > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From przemunio@REDACTED Tue May 2 20:07:19 2017 From: przemunio@REDACTED (Przemek) Date: Tue, 2 May 2017 20:07:19 +0200 Subject: [erlang-questions] Windows 10 Fast Startup compatibility with Erlang Message-ID: Hi, Recently I discovered that Fast Startup Windows 10 feature is causing unpredictable Erlang behavior, one example is that it is causing that service processes are put into some kind of sleep mode instead of stopping them and starting later. >From what I heard Erlang runtime does not work well when going into sleep mode, some timers work incorrectly then. I was struggling for almost one year with RabbitMQ being unresponsive for 2-3h every Monday, now I've found that Fast Startup is causing such mess. Currently I'm trying to find any resources related to Erlang and Fast Startup feature, does anybody know something about it? How to avoid such issue? Is it possible to provide some kind of fix in order to prevent such cases for Windows 10 users? Or at least letting them know that they should probably turn this feature off? Regards, Przemek D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yjin77@REDACTED Tue May 2 22:08:43 2017 From: yjin77@REDACTED (Yixin Jin) Date: Tue, 2 May 2017 20:08:43 +0000 (UTC) Subject: [erlang-questions] UNIX domain socket and seqpacket References: <788941277.1026593.1493755723494.ref@mail.yahoo.com> Message-ID: <788941277.1026593.1493755723494@mail.yahoo.com> Hi folks, I notice that since R19, there is now a temporary support for unix domain socket. We can use gen_udp:open() with option {ifaddr, {local, "/tmp/path"}}. But when I read gen_udp.erl, I noticed that it only opens the socket with type dgram. I wonder when the support of type seqpacket will be added. I am eager to make use of UNIX domain socket with seqpacket. Thanks Yixin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Wed May 3 06:14:41 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 3 May 2017 16:14:41 +1200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <20170502113345.GA47815@erix.ericsson.se> References: <20170425141404.GA26809@erix.ericsson.se> <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> <20170502113345.GA47815@erix.ericsson.se> Message-ID: <7BF06E99-30E7-4648-94D9-C9FB49700963@cs.otago.ac.nz> > On 2/05/2017, at 11:33 PM, Raimo Niskanen wrote: > > If the first byte is NUL and the length is larger than 0 then it must be an > abstract address. But when this comes from above (from Erlang) and since > we do not know if the host supports abstract addresses; if we give > the kernel a first byte NUL but address length longer than SUN_LEN(su), > will then we cause harm on some OS? I'm puzzled here. First, I thought the context was *receiving* a name, > when you get an address from e.g getsockname() which presumably must be acceptable to the system. Second, why don't we know if the host supports the Linux-only abstract address extension or not? Amongst other things, it is possible to find out by trying to a Linux domain socket with abstract address #[0 1] and length including two bytes. If that doesn't work, abstract addresses are not supported. This would be done just once, at installation. Wouldn't that work? From abhishek@REDACTED Wed May 3 08:54:05 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 12:24:05 +0530 (IST) Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: References: <288502270.56136.1493726259674@webmail.blacklightsw.com> Message-ID: <1522352057.27761.1493794445935@webmail.blacklightsw.com> Hi, I tried installing erlang from the packages link but it didn't worked for me somehow,then I tried installing it from source but instead of installing 6.1 Erlang/OTP 17.1 it installed erts 5.8.5 instead of 6.1. Then I decided to install it using kerl from the link [https://github.com/kerl/kerl](https://github.com/kerl/kerl) but after the command : chmod a+x kerl it is written that : drop it in your $PATH I am not able to understand what path is it talking about. Do we also have a root path like windows, in linux also? Can you please guide a little? Regards Abhishek > On May 2, 2017 at 6:04 PM Graham Hay wrote: > > Erlang Solutions provide pre-built binaries of newer versions: > > https://packages.erlang-solutions.com/erlang/ > > Or you can build it yourself (using e.g kerl). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 3 08:56:29 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 12:26:29 +0530 (IST) Subject: [erlang-questions] How to install a specific version of erlang and uninstall a previously installed version on linux In-Reply-To: <1522352057.27761.1493794445935@webmail.blacklightsw.com> References: <288502270.56136.1493726259674@webmail.blacklightsw.com> <1522352057.27761.1493794445935@webmail.blacklightsw.com> Message-ID: <179921735.28043.1493794589383@webmail.blacklightsw.com> sorry about the link it got typed twice. Regards Abhishek > On May 3, 2017 at 12:24 PM Abhishek Ranjan wrote: > > Hi, > I tried installing erlang from the packages link but it didn't worked for me somehow,then I tried installing it from source but instead of installing 6.1 Erlang/OTP 17.1 it installed erts 5.8.5 instead of 6.1. > Then I decided to install it using kerl from the link > [https://github.com/kerl/kerl](https://github.com/kerl/kerl) > > but after the command : chmod a+x kerl > it is written that : drop it in your $PATH > I am not able to understand what path is it talking about. Do we also have a root path like windows, in linux also? > Can you please guide a little? > Regards > Abhishek > > > > > On May 2, 2017 at 6:04 PM Graham Hay wrote: > > > > Erlang Solutions provide pre-built binaries of newer versions: > > > > https://packages.erlang-solutions.com/erlang/ > > > > Or you can build it yourself (using e.g kerl). > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zandra.norman@REDACTED Wed May 3 09:33:07 2017 From: zandra.norman@REDACTED (Zandra Norman) Date: Wed, 3 May 2017 07:33:07 +0000 Subject: [erlang-questions] Patch Package OTP 19.3.3 Released Message-ID: Patch Package: OTP 19.3.3 Git Tag: OTP-19.3.3 Date: 2017-05-02 Trouble Report Id: OTP-14360, OTP-14363, OTP-14368, OTP-14383 Seq num: System: OTP Release: 19 Application: dialyzer-3.1.1, erts-8.3.3, inets-6.3.8 Predecessor: OTP 19.3.2 Check out the git tag OTP-19.3.3, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- dialyzer-3.1.1 -------------------------------------------------- --------------------------------------------------------------------- Note! The dialyzer-3.1.1 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependency has to be satisfied: -- hipe-3.15.4 (first satisfied in OTP 19.3) --- Fixed Bugs and Malfunctions --- OTP-14368 Application(s): dialyzer Report unknown types properly. A bug was introduced in Erlang/OTP 19.3, where warnings about unknown types were simply discarded. Full runtime dependencies of dialyzer-3.1.1: compiler-7.0, erts-8.0, hipe-3.15.4, kernel-5.0, stdlib-3.0, syntax_tools-2.0, wx-1.2 --------------------------------------------------------------------- --- erts-8.3.3 ------------------------------------------------------ --------------------------------------------------------------------- Note! The erts-8.3.3 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependency has to be satisfied: -- sasl-3.0.1 (first satisfied in OTP 19.1) --- Fixed Bugs and Malfunctions --- OTP-14360 Application(s): erts Related Id(s): ERL-401, PR-1417 Fixed memory segment cache used for multiblock carriers. Huge (> 2GB) memory segments could cause a VM crash. Creation of such huge memory segments used for multiblock carriers is however very uncommon. OTP-14363 Application(s): erts Related Id(s): OTP-14290 Fix release note for OTP-14290 in ERTS version 8.3.1. It was erroneously placed under "Known Bugs and Problems". Full runtime dependencies of erts-8.3.3: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --- inets-6.3.8 ----------------------------------------------------- --------------------------------------------------------------------- The inets-6.3.8 application can be applied independently of other applications on a full OTP 19 installation. --- Improvements and New Features --- OTP-14383 Application(s): inets Added missing release note for inets-6.3.7 Full runtime dependencies of inets-6.3.8: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- Thanks to ------------------------------------------------------- --------------------------------------------------------------------- Mikael Pettersson --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Wed May 3 10:05:11 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 3 May 2017 10:05:11 +0200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <7BF06E99-30E7-4648-94D9-C9FB49700963@cs.otago.ac.nz> References: <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> <20170502113345.GA47815@erix.ericsson.se> <7BF06E99-30E7-4648-94D9-C9FB49700963@cs.otago.ac.nz> Message-ID: <20170503080511.GA48337@erix.ericsson.se> On Wed, May 03, 2017 at 04:14:41PM +1200, Richard A. O'Keefe wrote: > > > On 2/05/2017, at 11:33 PM, Raimo Niskanen wrote: > > > > If the first byte is NUL and the length is larger than 0 then it must be an > > abstract address. But when this comes from above (from Erlang) and since > > we do not know if the host supports abstract addresses; if we give > > the kernel a first byte NUL but address length longer than SUN_LEN(su), > > will then we cause harm on some OS? > > I'm puzzled here. First, I thought the context was *receiving* a name, > > when you get an address from e.g getsockname() > which presumably must be acceptable to the system. Sending a name is a bit more scary because we have to give the OS an ambiguity. When receiving a name there is the possibility that the an old OS might present a length that is the whole address structure while the actual address is a NUL terminated string (shorter), which might be a-ok according to Posix. I have not seen this, though, so hopefully it will never happen. Should it happen, the Erlang code will get a 0 terminated pathname with garbage after, when prepared for a pathname with no 0 termination. > > Second, why don't we know if the host supports the Linux-only > abstract address extension or not? > > Amongst other things, it is possible to find out by trying to > a Linux domain socket with abstract address #[0 1] and length > including two bytes. If that doesn't work, abstract addresses > are not supported. This would be done just once, at installation. > Wouldn't that work? That would be in a configure test, and running a program (AC_CHECK_PROG) from configure is not possible for cross-compilation, so there has to be a fallback configuration parameter to set for cross compilation, which is just awkward. Therefore AC_CHECK_PROG is preferably (strongly) avoided. Furtermore a test with AC_CHECK_PROG have to be able to recognize the situation when the tested address happens to be in use and see the difference between not supported and in use. So since this is an open source contribution I was hoping that someone else would solve the details of the problem. I, as you, does not have this on my list of things that *has* to be done right now... > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From fernando.benavides@REDACTED Wed May 3 10:48:39 2017 From: fernando.benavides@REDACTED (Brujo Benavides) Date: Wed, 3 May 2017 09:48:39 +0100 Subject: [erlang-questions] gen_server init returns {stop, Reason} and fails: possibly doc bug? In-Reply-To: References: Message-ID: <37235CC2-F849-4B77-9F3A-BA431338CB6D@inakanetworks.com> You?re correct. To be able to use the result of gen_server:start_link you must be trapping exits. I wrote a blog post about it a while back. Cheers! > On May 2, 2017, at 11:57, Max Lapshin wrote: > > > Here: http://erlang.org/doc/man/gen_server.html#start_link-3 we can read that start_link will return {error, Reason} if init callback returns {stop, Reason} > > > Maybe I'm wrong, but it seems that it is not possible to get back clean reply, because gen_server.erl has following code: > > proc_lib:init_ack(Starter, {error, Reason}), % here we may receive error tuple > exit(Reason) > > After exit caller is failing because of linkage. So if we want to have start_link, we cannot get clean logs and clearly get {error, Reason} tuple. > > Am I wrong? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 3 11:22:46 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 14:52:46 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found but required Message-ID: <530791490.42017.1493803366646@webmail.blacklightsw.com> I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. I then used ./autogen.sh command which ran without any output then: ./configure which gave this error configure: error: Erlang/OTP interpreter (erl) not found but required Can anyone help? Regards, Abhishek -------------- next part -------------- An HTML attachment was scrubbed... URL: From himars@REDACTED Wed May 3 11:36:33 2017 From: himars@REDACTED (Jack Tang) Date: Wed, 3 May 2017 17:36:33 +0800 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found but required In-Reply-To: <530791490.42017.1493803366646@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> Message-ID: You might miss to run `$ . /path/to/install/dir/activate`. On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > I was installing ejabberd 17.03 through source code when I found that I > needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using > kerl inside the /home/ec2-user/kerl/17.1 directory. > > I then used ./autogen.sh command which ran without any output > > then: ./configure which gave this error > > configure: error: Erlang/OTP interpreter (erl) not found but required > > Can anyone help? > > Regards, > > Abhishek > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Jack Tang http://www.linkedin.com/in/jacktang -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 3 11:46:01 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 15:16:01 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found but required In-Reply-To: References: <530791490.42017.1493803366646@webmail.blacklightsw.com> Message-ID: <1469879516.44178.1493804761921@webmail.blacklightsw.com> home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate command when I was in this home directory. I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ and run ./configure command it is giving me this error. what I understand is the line which you are saying that I missed is the same line as KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate but may be I gave a wrong path or ran it from wrong place (home/ec2-user). I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ Can you gauge where I am going wrong exactly > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > You might miss to run `$ . /path/to/install/dir/activate`. > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > I then used ./autogen.sh command which ran without any output > > > > then: ./configure which gave this error > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > Can anyone help? > > > > Regards, > > > > Abhishek > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > -- > Jack Tang > > > http://www.linkedin.com/in/jacktang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbike2000ru@REDACTED Wed May 3 12:24:12 2017 From: mbike2000ru@REDACTED (Dmitry) Date: Wed, 3 May 2017 10:24:12 +0000 (UTC) Subject: [erlang-questions] rebar compile eunit generates an error References: <328861152.1251966.1493807052097.ref@mail.yahoo.com> Message-ID: <328861152.1251966.1493807052097@mail.yahoo.com> Hello When I issue a comand? # rebar compile eunit the followin error is generated==> acceptor (compile)Uncaught error in rebar_core: {'EXIT',? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{{badmatch,{error,bad_directory}},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{rebar_core,process_commands,2,? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{file,"src/rebar_core.erl"},{line,92}]},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{rebar,main,1,? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{file,"src/rebar.erl"},{line,58}]},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{escript,run,2,? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{file,"escript.erl"},{line,757}]},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{escript,start,1,? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{file,"escript.erl"},{line,277}]},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{init,start_it,1,[]},? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{init,start_em,1,[]}]}} How to solve this issue? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nayibor@REDACTED Wed May 3 12:31:34 2017 From: nayibor@REDACTED (Nuku Ameyibor) Date: Wed, 3 May 2017 10:31:34 +0000 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1469879516.44178.1493804761921@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> Message-ID: <5909b1b5.89aadf0a.1969a.b088@mx.google.com> @ Ranjan, KERL_ENABLE_PROMPT=Y . ~/kerl/17.1/activate They are two separate commands not one command. Run them one after the other . After that run which erl That command will show you the path to your current activated erlang version . -----Original Message----- From: "Abhishek Ranjan" Sent: ?5/?3/?2017 9:46 AM To: "Jack Tang" ; "Erlang-Questions Questions" Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate command when I was in this home directory. I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ and run ./configure command it is giving me this error. what I understand is the line which you are saying that I missed is the same line as KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate but may be I gave a wrong path or ran it from wrong place (home/ec2-user). I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ Can you gauge where I am going wrong exactly On May 3, 2017 at 3:06 PM Jack Tang wrote: You might miss to run `$ . /path/to/install/dir/activate`. On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. I then used ./autogen.sh command which ran without any output then: ./configure which gave this error configure: error: Erlang/OTP interpreter (erl) not found but required Can anyone help? Regards, Abhishek _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -- Jack Tang http://www.linkedin.com/in/jacktang _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 3 12:47:11 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 16:17:11 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <5909b1b5.89aadf0a.1969a.b088@mx.google.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> Message-ID: <1369425332.50059.1493808431077@webmail.blacklightsw.com> it is giving me this path "/kerl/17.1/bin/erl" which is actually inside /home/ec2-user/ what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside /home/ec2-user//kerl/17.1/bin/erl So is there any way I can change this path to /usr/bin. Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > @ Ranjan, > > KERL_ENABLE_PROMPT=Y > . ~/kerl/17.1/activate > They are two separate commands not one command. > Run them one after the other . > After that run > which erl > That command will show you the path to your current activated erlang version . > > > > --------------------------------------------- > From: Abhishek Ranjan mailto:abhishek@REDACTED > Sent: ?5/?3/?2017 9:46 AM > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > command when I was in this home directory. > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > and run ./configure command it is giving me this error. > what I understand is the line which you are saying that I missed is the same line as > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > Can you gauge where I am going wrong exactly > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > then: ./configure which gave this error > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > Can anyone help? > > > > > > Regards, > > > > > > Abhishek > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > -- > > Jack Tang > > > > > > http://www.linkedin.com/in/jacktang > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leonard.boyce@REDACTED Wed May 3 13:13:18 2017 From: leonard.boyce@REDACTED (Leonard B) Date: Wed, 3 May 2017 07:13:18 -0400 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1369425332.50059.1493808431077@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> Message-ID: On May 3, 2017 06:47, "Abhishek Ranjan" wrote: it is giving me this path "/kerl/17.1/bin/erl" which is actually inside /home/ec2-user/ what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside /home/ec2-user//kerl/17.1/bin/erl So is there any way I can change this path to /usr/bin. Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). How about following a guide step by step for Fedora, not OSX. A quick Google yields some simple instructions. https://medium.com/@bruceyinhe/erlang-quick-install-a3b7fd96947f On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: @ Ranjan, KERL_ENABLE_PROMPT=Y . ~/kerl/17.1/activate They are two separate commands not one command. Run them one after the other . After that run which erl That command will show you the path to your current activated erlang version . ------------------------------ From: Abhishek Ranjan Sent: ?5/?3/?2017 9:46 AM To: Jack Tang ; Erlang-Questions Questions Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate command when I was in this home directory. I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ ejabberd.17.03/ and run ./configure command it is giving me this error. what I understand is the line which you are saying that I missed is the same line as KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate but may be I gave a wrong path or ran it from wrong place (home/ec2-user). I followed: https://yrsdi.github.io/programming/setup-erlang-with- kerl-mac-osx/ Can you gauge where I am going wrong exactly On May 3, 2017 at 3:06 PM Jack Tang wrote: You might miss to run `$ . /path/to/install/dir/activate`. On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > I was installing ejabberd 17.03 through source code when I found that I > needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using > kerl inside the /home/ec2-user/kerl/17.1 directory. > > I then used ./autogen.sh command which ran without any output > > then: ./configure which gave this error > > configure: error: Erlang/OTP interpreter (erl) not found but required > > Can anyone help? > > Regards, > > Abhishek > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Jack Tang http://www.linkedin.com/in/jacktang _______________________________________________ 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 abhishek@REDACTED Wed May 3 13:35:16 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 17:05:16 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1369425332.50059.1493808431077@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> Message-ID: <1107624129.54733.1493811316572@webmail.blacklightsw.com> I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required Complete scenario went something like this: [ec2-user@REDACTED ~]$ kerl list builds 17.1,erlang-17.1 17.1,erl [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl [ec2-user@REDACTED ~]$ erl -bash: erl: command not found [ec2-user@REDACTED ~]$ kerl active No Erlang/OTP kerl installation is currently active [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate [ec2-user@REDACTED ~]$ kerl active The current active installation is: /home/ec2-user/kerl/17.1 [ec2-user@REDACTED ~]$ erl Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.1 (abort with ^G) 1> q(). ok 2> [ec2-user@REDACTED ~]$ cd downloads/ [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ [ec2-user@REDACTED ejabberd-17.03]$ ./configure ./configure: line 1529: config.log: Permission denied ./configure: line 1539: config.log: Permission denied [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh autom4te: cannot open autom4te.cache/requests: Permission denied aclocal: error: echo failed with exit status: 1 autom4te: cannot open autom4te.cache/requests: Permission denied [ec2-user@REDACTED ejabberd-17.03]$ yum install automake Loaded plugins: priorities, update-motd, upgrade-helper You need to be root to perform this command. [ec2-user@REDACTED ejabberd-17.03]$ sudo su [root@REDACTED ejabberd-17.03]# yum install automake Loaded plugins: priorities, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00 amzn-updates | 2.3 kB 00:00 Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version Nothing to do [root@REDACTED ejabberd-17.03]# ./autogen.sh [root@REDACTED ejabberd-17.03]# ./configure checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a sed that does not truncate output... /bin/sed checking for erl... no checking for erlc... /usr/bin/erlc checking for epmd... /usr/bin/epmd checking for erl... no configure: error: Erlang/OTP interpreter (erl) not found but required > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > it is giving me this path "/kerl/17.1/bin/erl" > which is actually inside /home/ec2-user/ > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > /home/ec2-user//kerl/17.1/bin/erl > > So is there any way I can change this path to /usr/bin. > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > @ Ranjan, > > > > KERL_ENABLE_PROMPT=Y > > . ~/kerl/17.1/activate > > They are two separate commands not one command. > > Run them one after the other . > > After that run > > which erl > > That command will show you the path to your current activated erlang version . > > > > > > > > --------------------------------------------- > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > Sent: ?5/?3/?2017 9:46 AM > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > command when I was in this home directory. > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > and run ./configure command it is giving me this error. > > what I understand is the line which you are saying that I missed is the same line as > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > Can you gauge where I am going wrong exactly > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > then: ./configure which gave this error > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > Can anyone help? > > > > > > > > Regards, > > > > > > > > Abhishek > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Jack Tang > > > > > > > > > http://www.linkedin.com/in/jacktang > > > _______________________________________________ > > > 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 arunp@REDACTED Wed May 3 13:52:52 2017 From: arunp@REDACTED (Arun) Date: Wed, 3 May 2017 17:22:52 +0530 Subject: [erlang-questions] snmp application up time Message-ID: <5909C494.6070508@utl.in> Hi all, Is there any function available in erlang snmp libraries to get the snmp application up time.? Regards, Arun From nayibor@REDACTED Wed May 3 14:15:57 2017 From: nayibor@REDACTED (Nuku Ameyibor) Date: Wed, 3 May 2017 12:15:57 +0000 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1107624129.54733.1493811316572@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> Message-ID: [ec2-user@REDACTED ~]$ *export PATH=$PATH: ~/kerl/17.1/bin/erl* this line is wrong .it should be * export PATH=$PATH: ~/kerl/17.1/bin* also in this step [ec2-user@REDACTED ejabberd-17.03]$ *./configure* it should be * ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin* also i though you were installing on a fedora box ? why not try the fedora option for the erlang installation ? On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > I actually followed it apart from the export command so after using export > path command also the error still pops up that -> configure: error: > Erlang/OTP interpreter (erl) not found but required > Complete scenario went something like this: > > [ec2-user@REDACTED ~]$ kerl list builds > 17.1,erlang-17.1 > 17.1,erl > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/ > kerl/17.1/bin/erl > [ec2-user@REDACTED ~]$ erl > -bash: erl: command not found > [ec2-user@REDACTED ~]$ kerl active > No Erlang/OTP kerl installation is currently active > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/ > kerl/17.1/bin/erl > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > [ec2-user@REDACTED ~]$ kerl active > The current active installation is: > /home/ec2-user/kerl/17.1 > [ec2-user@REDACTED ~]$ erl > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] > [kernel-poll:false] > > Eshell V6.1 (abort with ^G) > 1> q(). > ok > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > ./configure: line 1529: config.log: Permission denied > ./configure: line 1539: config.log: Permission denied > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > autom4te: cannot open autom4te.cache/requests: Permission denied > aclocal: error: echo failed with exit status: 1 > autom4te: cannot open autom4te.cache/requests: Permission denied > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > Loaded plugins: priorities, update-motd, upgrade-helper > You need to be root to perform this command. > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > [root@REDACTED ejabberd-17.03]# yum install automake > Loaded plugins: priorities, update-motd, upgrade-helper > amzn-main | 2.1 kB 00:00 > amzn-updates | 2.3 kB 00:00 > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest > version > Nothing to do > [root@REDACTED ejabberd-17.03]# ./autogen.sh > [root@REDACTED ejabberd-17.03]# ./configure > checking whether make sets $(MAKE)... yes > checking for a BSD-compatible install... /usr/bin/install -c > checking for a sed that does not truncate output... /bin/sed > checking for erl... no > checking for erlc... /usr/bin/erlc > checking for epmd... /usr/bin/epmd > checking for erl... no > configure: error: Erlang/OTP interpreter (erl) not found but required > > On May 3, 2017 at 4:17 PM Abhishek Ranjan > wrote: > > it is giving me this path "/kerl/17.1/bin/erl" > which is actually inside /home/ec2-user/ > > what I feel is that this erl should have been inside /usr/bin/ directory > and instead it is inside > /home/ec2-user//kerl/17.1/bin/erl > > So is there any way I can change this path to /usr/bin. > Please tell me if I am thinking right first and if so how can this be done > in linux(amazon linux or fedora). > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > @ Ranjan, > > KERL_ENABLE_PROMPT=Y > . ~/kerl/17.1/activate > They are two separate commands not one command. > Run them one after the other . > After that run > which erl > That command will show you the path to your current activated erlang > version . > > > ------------------------------ > From: Abhishek Ranjan > Sent: ?5/?3/?2017 9:46 AM > To: Jack Tang ; Erlang-Questions Questions > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found > butrequired > > home/ec2-user is my home directory or should I say the default directory > when I make the ssh connection to server. > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > command when I was in this home directory. > I think I missed a trick here as I am not familiar with linux and how to > set path in linux and that's why maybe when I go to home/ec2-user/download/ > ejabberd.17.03/ > and run ./configure command it is giving me this error. > what I understand is the line which you are saying that I missed is the > same line as > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > I followed: https://yrsdi.github.io/programming/setup-erlang-with- > kerl-mac-osx/ > Can you gauge where I am going wrong exactly > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > You might miss to run `$ . /path/to/install/dir/activate`. > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan > wrote: > >> I was installing ejabberd 17.03 through source code when I found that I >> needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using >> kerl inside the /home/ec2-user/kerl/17.1 directory. >> >> I then used ./autogen.sh command which ran without any output >> >> then: ./configure which gave this error >> >> configure: error: Erlang/OTP interpreter (erl) not found but required >> >> Can anyone help? >> >> Regards, >> >> Abhishek >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Jack Tang > > > http://www.linkedin.com/in/jacktang > _______________________________________________ > 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 abhishek@REDACTED Wed May 3 14:55:33 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 18:25:33 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> Message-ID: <1773357768.62619.1493816133328@webmail.blacklightsw.com> No i am still getting the same error and the line ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin is giving the following error too [root@REDACTED ejabberd-17.03]# ./configure ?Bindir=~/home/ec2-user/kerl/ 17.1/bin configure: error: invalid variable name: `?Bindir' Actually it is a amazon aws linux instance and it 's is the only option I have for now. Any Ideas on how to make it work or any ideas on how to install ejabberd 17.03 or higher in this environment. I have already tried the binary installer and it worked at start but it didn't work on second installation. http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws kindly help. > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > this line is wrong .it should be > export PATH=$PATH: ~/kerl/17.1/bin > > also in this step > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > it should be > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > also i though you were installing on a fedora box ? > why not try the fedora option for the erlang installation ? > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > > > > I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required > > Complete scenario went something like this: > > > > [ec2-user@REDACTED ~]$ kerl list builds > > 17.1,erlang-17.1 > > 17.1,erl > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > [ec2-user@REDACTED ~]$ erl > > -bash: erl: command not found > > [ec2-user@REDACTED ~]$ kerl active > > No Erlang/OTP kerl installation is currently active > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > > [ec2-user@REDACTED ~]$ kerl active > > The current active installation is: > > /home/ec2-user/kerl/17.1 > > [ec2-user@REDACTED ~]$ erl > > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V6.1 (abort with ^G) > > 1> q(). > > ok > > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > ./configure: line 1529: config.log: Permission denied > > ./configure: line 1539: config.log: Permission denied > > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > > autom4te: cannot open autom4te.cache/requests: Permission denied > > aclocal: error: echo failed with exit status: 1 > > autom4te: cannot open autom4te.cache/requests: Permission denied > > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > > Loaded plugins: priorities, update-motd, upgrade-helper > > You need to be root to perform this command. > > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > > [root@REDACTED ejabberd-17.03]# yum install automake > > Loaded plugins: priorities, update-motd, upgrade-helper > > amzn-main | 2.1 kB 00:00 > > amzn-updates | 2.3 kB 00:00 > > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version > > Nothing to do > > [root@REDACTED ejabberd-17.03]# ./autogen.sh > > [root@REDACTED ejabberd-17.03]# ./configure > > checking whether make sets $(MAKE)... yes > > checking for a BSD-compatible install... /usr/bin/install -c > > checking for a sed that does not truncate output... /bin/sed > > checking for erl... no > > checking for erlc... /usr/bin/erlc > > checking for epmd... /usr/bin/epmd > > checking for erl... no > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > > > > > it is giving me this path "/kerl/17.1/bin/erl" > > > which is actually inside /home/ec2-user/ > > > > > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > > > /home/ec2-user//kerl/17.1/bin/erl > > > > > > So is there any way I can change this path to /usr/bin. > > > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > > > > > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > > > > > @ Ranjan, > > > > > > > > KERL_ENABLE_PROMPT=Y > > > > . ~/kerl/17.1/activate > > > > They are two separate commands not one command. > > > > Run them one after the other . > > > > After that run > > > > which erl > > > > That command will show you the path to your current activated erlang version . > > > > > > > > > > > > > > > > --------------------------------------------- > > > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > > > Sent: ?5/?3/?2017 9:46 AM > > > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > command when I was in this home directory. > > > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > > > and run ./configure command it is giving me this error. > > > > what I understand is the line which you are saying that I missed is the same line as > > > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > > > Can you gauge where I am going wrong exactly > > > > > > > > > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > > > > > then: ./configure which gave this error > > > > > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > Can anyone help? > > > > > > > > > > > > Regards, > > > > > > > > > > > > Abhishek > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Jack Tang > > > > > > > > > > > > > > > http://www.linkedin.com/in/jacktang http://www.linkedin.com/in/jacktang > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Wed May 3 15:03:53 2017 From: rvirding@REDACTED (Robert Virding) Date: Wed, 3 May 2017 15:03:53 +0200 Subject: [erlang-questions] Exit signals are funny things Message-ID: So: 1> Pid = spawn_link(fun() -> timer:sleep(infinity) end). <0.59.0> 2> exit(Pid, normal). true 3> flush(). ok 4> exit(Pid, die). ** exception exit: die I spawn_link a process which is not trapping and send it the signal 'normal' which it ignores. As it should. I then send it the signal 'die' and it crashes. As it should. Now: 5> exit(self(), normal). ** exception exit: normal Now I send myself the signal 'normal' and I die! So there is 'normal' and there is 'normal' depending on to whom I send it. Where's the logic in that? Robert P.S. More to come -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernando.benavides@REDACTED Wed May 3 15:09:51 2017 From: fernando.benavides@REDACTED (Brujo Benavides) Date: Wed, 3 May 2017 14:09:51 +0100 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: <676AB73D-93D1-4874-AD59-C43A29DB733D@inakanetworks.com> Furthermore? 1> Self = self(). <0.68.0> 2> spawn(fun() -> exit(Self, normal) end). <0.71.0> 3> flush(). ok 4> self(). <0.68.0> 5> spawn(fun() -> exit(Self, not_normal) end). ** exception exit: not_normal 6> self(). <0.76.0> 7> So, if some other process sends me a normal exit signal, it works as expected. > On May 3, 2017, at 14:03, Robert Virding wrote: > > So: > > 1> Pid = spawn_link(fun() -> timer:sleep(infinity) end). > <0.59.0> > 2> exit(Pid, normal). > true > 3> flush(). > ok > 4> exit(Pid, die). > ** exception exit: die > > I spawn_link a process which is not trapping and send it the signal 'normal' which it ignores. As it should. I then send it the signal 'die' and it crashes. As it should. > > Now: > > 5> exit(self(), normal). > ** exception exit: normal > > Now I send myself the signal 'normal' and I die! So there is 'normal' and there is 'normal' depending on to whom I send it. > > Where's the logic in that? > > Robert > > P.S. More to come > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Wed May 3 15:14:10 2017 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Wed, 3 May 2017 15:14:10 +0200 Subject: [erlang-questions] snmp application up time In-Reply-To: <5909C494.6070508@utl.in> References: <5909C494.6070508@utl.in> Message-ID: Hello! Try snmpa:sys_up_time/0. 2017-05-03 13:52 GMT+02:00 Arun : > Hi all, > > Is there any function available in erlang snmp libraries to get the snmp > application up time.? > > Regards, > Arun > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From comptekki@REDACTED Wed May 3 15:20:59 2017 From: comptekki@REDACTED (Wes James) Date: Wed, 3 May 2017 07:20:59 -0600 Subject: [erlang-questions] Windows 10 Fast Startup compatibility with Erlang In-Reply-To: References: Message-ID: Does this help any: http://lifehacker.com/enable-this-setting-to-make-windows-10-boot-up-faster-1743697169 Turn it off?? -wes On Tue, May 2, 2017 at 12:07 PM, Przemek wrote: > Hi, > > Recently I discovered that Fast Startup Windows 10 feature is causing > unpredictable Erlang behavior, one example is that it is causing that > service processes are put into some kind of sleep mode instead of stopping > them and starting later. > From what I heard Erlang runtime does not work well when going into sleep > mode, some timers work incorrectly then. I was struggling for almost one > year with RabbitMQ being unresponsive for 2-3h every Monday, now I've found > that Fast Startup is causing such mess. > > Currently I'm trying to find any resources related to Erlang and Fast > Startup feature, does anybody know something about it? How to avoid such > issue? Is it possible to provide some kind of fix in order to prevent such > cases for Windows 10 users? Or at least letting them know that they should > probably turn this feature off? > > > Regards, > Przemek D. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 3 15:27:51 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 3 May 2017 18:57:51 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1773357768.62619.1493816133328@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> Message-ID: <235992290.65193.1493818071491@webmail.blacklightsw.com> I did an uninstall of the previous version of erlang and the ./configure gave following errors [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a sed that does not truncate output... /bin/sed checking for erl... no checking for erlc... no checking for epmd... no checking for erl... no configure: error: Erlang/OTP interpreter (erl) not found but required and that is why I was suspecting that whenever I run the ./configure command the script goes to /usr/bin and search for erl ,erlc....etc That is why I asked that is there any way that I can set my erl path to /usr/bin which is currently gives that following path on "which erl" ~/kerl/17.1/bin/erl or should I install erlang again. if so can anyone tell me how to make the erl path specifically such that it points to /usr/bin and still the erlang shell works on typing erl alone? > On May 3, 2017 at 6:25 PM Abhishek Ranjan wrote: > > No i am still getting the same error and the line > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > is giving the following error too > > [root@REDACTED ejabberd-17.03]# ./configure ?Bindir=~/home/ec2-user/kerl/ 17.1/bin > configure: error: invalid variable name: `?Bindir' > > Actually it is a amazon aws linux instance and it 's is the only option I have for now. > Any Ideas on how to make it work or any ideas on how to install ejabberd 17.03 or higher in this environment. I have already tried the binary installer and it worked at start but it didn't work on second installation. > http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws > > kindly help. > > > > > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > this line is wrong .it should be > > export PATH=$PATH: ~/kerl/17.1/bin > > > > also in this step > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > it should be > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > also i though you were installing on a fedora box ? > > why not try the fedora option for the erlang installation ? > > > > > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > > > > > > > I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required > > > Complete scenario went something like this: > > > > > > [ec2-user@REDACTED ~]$ kerl list builds > > > 17.1,erlang-17.1 > > > 17.1,erl > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > [ec2-user@REDACTED ~]$ erl > > > -bash: erl: command not found > > > [ec2-user@REDACTED ~]$ kerl active > > > No Erlang/OTP kerl installation is currently active > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > > > [ec2-user@REDACTED ~]$ kerl active > > > The current active installation is: > > > /home/ec2-user/kerl/17.1 > > > [ec2-user@REDACTED ~]$ erl > > > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] > > > > > > Eshell V6.1 (abort with ^G) > > > 1> q(). > > > ok > > > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > ./configure: line 1529: config.log: Permission denied > > > ./configure: line 1539: config.log: Permission denied > > > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > aclocal: error: echo failed with exit status: 1 > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > You need to be root to perform this command. > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > > > [root@REDACTED ejabberd-17.03]# yum install automake > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > amzn-main | 2.1 kB 00:00 > > > amzn-updates | 2.3 kB 00:00 > > > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version > > > Nothing to do > > > [root@REDACTED ejabberd-17.03]# ./autogen.sh > > > [root@REDACTED ejabberd-17.03]# ./configure > > > checking whether make sets $(MAKE)... yes > > > checking for a BSD-compatible install... /usr/bin/install -c > > > checking for a sed that does not truncate output... /bin/sed > > > checking for erl... no > > > checking for erlc... /usr/bin/erlc > > > checking for epmd... /usr/bin/epmd > > > checking for erl... no > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > > > > > > > it is giving me this path "/kerl/17.1/bin/erl" > > > > which is actually inside /home/ec2-user/ > > > > > > > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > > > > /home/ec2-user//kerl/17.1/bin/erl > > > > > > > > So is there any way I can change this path to /usr/bin. > > > > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > > > > > > > @ Ranjan, > > > > > > > > > > KERL_ENABLE_PROMPT=Y > > > > > . ~/kerl/17.1/activate > > > > > They are two separate commands not one command. > > > > > Run them one after the other . > > > > > After that run > > > > > which erl > > > > > That command will show you the path to your current activated erlang version . > > > > > > > > > > > > > > > > > > > > --------------------------------------------- > > > > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > > > > Sent: ?5/?3/?2017 9:46 AM > > > > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > > > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > > > > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > > > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > command when I was in this home directory. > > > > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > > > > and run ./configure command it is giving me this error. > > > > > what I understand is the line which you are saying that I missed is the same line as > > > > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > > > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > > > > Can you gauge where I am going wrong exactly > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > > > > > > > then: ./configure which gave this error > > > > > > > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > Can anyone help? > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > Abhishek > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > erlang-questions mailing list > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Jack Tang > > > > > > > > > > > > > > > > > > http://www.linkedin.com/in/jacktang http://www.linkedin.com/in/jacktang > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.des.courtis@REDACTED Wed May 3 16:06:56 2017 From: eric.des.courtis@REDACTED (Eric des Courtis) Date: Wed, 3 May 2017 10:06:56 -0400 Subject: [erlang-questions] Fwd: Windows 10 Fast Startup compatibility with Erlang In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Eric des Courtis Date: Wed, May 3, 2017 at 10:06 AM Subject: Re: [erlang-questions] Windows 10 Fast Startup compatibility with Erlang To: Przemek Is the service starting with erlsrv? If so you could be as easy as changing the service to delayed start. https://blogs.technet.microsoft.com/askperf/2008/02/ 02/ws2008-startup-processes-and-delayed-automatic-start/ On Tue, May 2, 2017 at 2:07 PM, Przemek wrote: > Hi, > > Recently I discovered that Fast Startup Windows 10 feature is causing > unpredictable Erlang behavior, one example is that it is causing that > service processes are put into some kind of sleep mode instead of stopping > them and starting later. > From what I heard Erlang runtime does not work well when going into sleep > mode, some timers work incorrectly then. I was struggling for almost one > year with RabbitMQ being unresponsive for 2-3h every Monday, now I've found > that Fast Startup is causing such mess. > > Currently I'm trying to find any resources related to Erlang and Fast > Startup feature, does anybody know something about it? How to avoid such > issue? Is it possible to provide some kind of fix in order to prevent such > cases for Windows 10 users? Or at least letting them know that they should > probably turn this feature off? > > > Regards, > Przemek D. > > _______________________________________________ > 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 Wed May 3 16:20:01 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 03 May 2017 14:20:01 +0000 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <235992290.65193.1493818071491@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> <235992290.65193.1493818071491@webmail.blacklightsw.com> Message-ID: The ejabberd build script may be a bit weak. * try using an explicit path rather than ~/... expand it to /home/ubuntu (or the output of echo ~) in order to make sure you don't get accidentally name expanded as root. * do not use sudo when building the software. It should build without. * ./configure --with-erlang=/home/ubuntu/kerl/17.1 or set ERLC=$(which erlc) and also set ERL=$(which erl) Configure scripts can *definitely* build without the Erlang being in the default location. It is just a question of coercion. On Wed, May 3, 2017 at 3:28 PM Abhishek Ranjan wrote: > I did an uninstall of the previous version of erlang and the ./configure > gave following errors > > [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure > > checking whether make sets $(MAKE)... yes > checking for a BSD-compatible install... /usr/bin/install -c > checking for a sed that does not truncate output... /bin/sed > checking for erl... no > checking for erlc... no > checking for epmd... no > > checking for erl... no > configure: error: Erlang/OTP interpreter (erl) not found but required > > and that is why I was suspecting that whenever I run the ./configure > command the script goes to > /usr/bin > and search for erl ,erlc....etc > That is why I asked that is there any way that I can set my erl path to > /usr/bin which is currently gives that following path on "which erl" > ~/kerl/17.1/bin/erl > > or should I install erlang again. if so can anyone tell me how to make the > erl path specifically such that it points to /usr/bin and still the erlang > shell works on typing erl alone? > > > On May 3, 2017 at 6:25 PM Abhishek Ranjan > wrote: > > No i am still getting the same error and the line > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > is giving the following error too > > [root@REDACTED ejabberd-17.03]# ./configure > ?Bindir=~/home/ec2-user/kerl/ 17.1/bin > configure: error: invalid variable name: `?Bindir' > > Actually it is a amazon aws linux instance and it 's is the only option I > have for now. > Any Ideas on how to make it work or any ideas on how to install ejabberd > 17.03 or higher in this environment. I have already tried the binary > installer and it worked at start but it didn't work on second installation. > > http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws > > kindly help. > > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > [ec2-user@REDACTED ~]$ *export PATH=$PATH: ~/kerl/17.1/bin/erl* > > this line is wrong .it should be > * export PATH=$PATH: ~/kerl/17.1/bin* > > also in this step > [ec2-user@REDACTED ejabberd-17.03]$ *./configure* > it should be > * ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin* > > also i though you were installing on a fedora box ? > why not try the fedora option for the erlang installation ? > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan < > abhishek@REDACTED> wrote: > >> I actually followed it apart from the export command so after using >> export path command also the error still pops up that -> configure: error: >> Erlang/OTP interpreter (erl) not found but required >> Complete scenario went something like this: >> >> [ec2-user@REDACTED ~]$ kerl list builds >> 17.1,erlang-17.1 >> 17.1,erl >> [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl >> -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier >> >> [ec2-user@REDACTED ~]$ export >> PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl >> [ec2-user@REDACTED ~]$ erl >> -bash: erl: command not found >> [ec2-user@REDACTED ~]$ kerl active >> No Erlang/OTP kerl installation is currently active >> [ec2-user@REDACTED ~]$ export >> PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl >> >> >> [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate >> [ec2-user@REDACTED ~]$ kerl active >> The current active installation is: >> /home/ec2-user/kerl/17.1 >> [ec2-user@REDACTED ~]$ erl >> Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] >> [kernel-poll:false] >> >> Eshell V6.1 (abort with ^G) >> 1> q(). >> ok >> 2> [ec2-user@REDACTED ~]$ cd downloads/ >> >> [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ >> [ec2-user@REDACTED ejabberd-17.03]$ ./configure >> ./configure: line 1529: config.log: Permission denied >> ./configure: line 1539: config.log: Permission denied >> [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh >> autom4te: cannot open autom4te.cache/requests: Permission denied >> aclocal: error: echo failed with exit status: 1 >> autom4te: cannot open autom4te.cache/requests: Permission denied >> [ec2-user@REDACTED ejabberd-17.03]$ yum install automake >> Loaded plugins: priorities, update-motd, upgrade-helper >> You need to be root to perform this command. >> [ec2-user@REDACTED ejabberd-17.03]$ sudo su >> [root@REDACTED ejabberd-17.03]# yum install automake >> Loaded plugins: priorities, update-motd, upgrade-helper >> amzn-main | 2.1 kB 00:00 >> amzn-updates | 2.3 kB 00:00 >> Package automake-1.13.4-3.15.amzn1.noarch already installed and latest >> version >> Nothing to do >> [root@REDACTED ejabberd-17.03]# ./autogen.sh >> [root@REDACTED ejabberd-17.03]# ./configure >> checking whether make sets $(MAKE)... yes >> checking for a BSD-compatible install... /usr/bin/install -c >> checking for a sed that does not truncate output... /bin/sed >> checking for erl... no >> checking for erlc... /usr/bin/erlc >> checking for epmd... /usr/bin/epmd >> checking for erl... no >> configure: error: Erlang/OTP interpreter (erl) not found but required >> >> On May 3, 2017 at 4:17 PM Abhishek Ranjan >> wrote: >> >> it is giving me this path "/kerl/17.1/bin/erl" >> which is actually inside /home/ec2-user/ >> >> what I feel is that this erl should have been inside /usr/bin/ directory >> and instead it is inside >> /home/ec2-user//kerl/17.1/bin/erl >> >> So is there any way I can change this path to /usr/bin. >> Please tell me if I am thinking right first and if so how can this be >> done in linux(amazon linux or fedora). >> >> On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: >> >> @ Ranjan, >> >> KERL_ENABLE_PROMPT=Y >> . ~/kerl/17.1/activate >> They are two separate commands not one command. >> Run them one after the other . >> After that run >> which erl >> That command will show you the path to your current activated erlang >> version . >> >> >> ------------------------------ >> From: Abhishek Ranjan >> Sent: ?5/?3/?2017 9:46 AM >> To: Jack Tang ; Erlang-Questions Questions >> >> Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found >> butrequired >> >> home/ec2-user is my home directory or should I say the default directory >> when I make the ssh connection to server. >> so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate >> command when I was in this home directory. >> I think I missed a trick here as I am not familiar with linux and how to >> set path in linux and that's why maybe when I go to >> home/ec2-user/download/ejabberd.17.03/ >> and run ./configure command it is giving me this error. >> what I understand is the line which you are saying that I missed is the >> same line as >> KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate >> but may be I gave a wrong path or ran it from wrong place (home/ec2-user). >> I followed: >> https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ >> Can you gauge where I am going wrong exactly >> >> On May 3, 2017 at 3:06 PM Jack Tang wrote: >> >> You might miss to run `$ . /path/to/install/dir/activate`. >> >> On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan < >> abhishek@REDACTED> wrote: >> >>> I was installing ejabberd 17.03 through source code when I found that I >>> needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using >>> kerl inside the /home/ec2-user/kerl/17.1 directory. >>> >>> I then used ./autogen.sh command which ran without any output >>> >>> then: ./configure which gave this error >>> >>> configure: error: Erlang/OTP interpreter (erl) not found but required >>> >>> Can anyone help? >>> >>> Regards, >>> >>> Abhishek >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> -- >> Jack Tang >> >> >> http://www.linkedin.com/in/jacktang >> _______________________________________________ >> 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 v@REDACTED Wed May 3 17:49:20 2017 From: v@REDACTED (Valentin Micic) Date: Wed, 3 May 2017 17:49:20 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: <3E227DCC-CBCA-4D64-B6A6-8CB9A1754108@pharos-avantgard.com> > Now: > > 5> exit(self(), normal). > ** exception exit: normal Death is a normal thing. Suicide, not so much. ;-) V/ From benmmurphy@REDACTED Wed May 3 18:05:40 2017 From: benmmurphy@REDACTED (Ben Murphy) Date: Wed, 3 May 2017 17:05:40 +0100 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: Well its a very deliberate decision by someone. erts/emulator/beam/bif.c: erts_send_exit_signal(BIF_P, BIF_P->common.id, rp, &rp_locks, BIF_ARG_2, NIL, NULL, BIF_P == rp ? ERTS_XSIG_FLG_NO_IGN_NORMAL : 0); It sends ERTS_XSIG_FLG_NO_IGN_NORMAL if you are sending a signal to yourself. On Wed, May 3, 2017 at 2:03 PM, Robert Virding wrote: > So: > > 1> Pid = spawn_link(fun() -> timer:sleep(infinity) end). > <0.59.0> > 2> exit(Pid, normal). > true > 3> flush(). > ok > 4> exit(Pid, die). > ** exception exit: die > > I spawn_link a process which is not trapping and send it the signal 'normal' > which it ignores. As it should. I then send it the signal 'die' and it > crashes. As it should. > > Now: > > 5> exit(self(), normal). > ** exception exit: normal > > Now I send myself the signal 'normal' and I die! So there is 'normal' and > there is 'normal' depending on to whom I send it. > > Where's the logic in that? > > Robert > > P.S. More to come > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From duncan@REDACTED Wed May 3 18:06:52 2017 From: duncan@REDACTED (duncan@REDACTED) Date: Wed, 03 May 2017 09:06:52 -0700 Subject: [erlang-questions] xref and cowboy callbacks Message-ID: <20170503090652.7e43b23f706d1a78218bd3e1c66e57ee.efe882be32.wbe@email23.godaddy.com> An HTML attachment was scrubbed... URL: From przemunio@REDACTED Wed May 3 18:13:47 2017 From: przemunio@REDACTED (Przemek) Date: Wed, 3 May 2017 18:13:47 +0200 Subject: [erlang-questions] Windows 10 Fast Startup compatibility with Erlang In-Reply-To: References: Message-ID: Hi Eric, Setting to delayed start will not help as the issue is related to Fast Startup which means that the Erlang proces is started (or delayed started) only at some rare occasions eg. I noticed that Windows 10 fully restarted all services when system files were updated by Windows Update. In other words Erlang service is usually not stopped when Windows 10 is being shut down, instead it is put into sleep mode. When computer is turned on again then there is no service start routine involved at all, the process is only put into running mode again. Regards Pozdrowienia, Przemek D. 2017-05-03 16:06 GMT+02:00 Eric des Courtis : > Is the service starting with erlsrv? If so you could be as easy as > changing the service to delayed start. > https://blogs.technet.microsoft.com/askperf/2008/02/ > 02/ws2008-startup-processes-and-delayed-automatic-start/ > > > On Tue, May 2, 2017 at 2:07 PM, Przemek wrote: > >> Hi, >> >> Recently I discovered that Fast Startup Windows 10 feature is causing >> unpredictable Erlang behavior, one example is that it is causing that >> service processes are put into some kind of sleep mode instead of stopping >> them and starting later. >> From what I heard Erlang runtime does not work well when going into sleep >> mode, some timers work incorrectly then. I was struggling for almost one >> year with RabbitMQ being unresponsive for 2-3h every Monday, now I've found >> that Fast Startup is causing such mess. >> >> Currently I'm trying to find any resources related to Erlang and Fast >> Startup feature, does anybody know something about it? How to avoid such >> issue? Is it possible to provide some kind of fix in order to prevent such >> cases for Windows 10 users? Or at least letting them know that they should >> probably turn this feature off? >> >> >> Regards, >> Przemek D. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From przemunio@REDACTED Wed May 3 18:21:49 2017 From: przemunio@REDACTED (Przemek) Date: Wed, 3 May 2017 18:21:49 +0200 Subject: [erlang-questions] Windows 10 Fast Startup compatibility with Erlang In-Reply-To: References: Message-ID: Hi Wes, This worked for me, I found the solution rather quickly when I discovered that Win 10 service processes are put into sleep mode instead of being stopped and started again. My intention was to help others running Erlang on Win 10 machines, Fast Startup is clearly not easy to spot as a cause. It took me a lot of time to discover this issue. Moreover I couldn't find anything interesting on web related to this. To help others: - somebody could provide a fix for such cases, is it possible? - there could be some web page on Erlang main page which explicitly describe "Erlang Windows 10 quirks", is it possible? Regards Pozdrowienia, Przemek D. 2017-05-03 15:20 GMT+02:00 Wes James : > Does this help any: > > http://lifehacker.com/enable-this-setting-to-make-windows- > 10-boot-up-faster-1743697169 > > Turn it off?? > > -wes > > On Tue, May 2, 2017 at 12:07 PM, Przemek wrote: > >> Hi, >> >> Recently I discovered that Fast Startup Windows 10 feature is causing >> unpredictable Erlang behavior, one example is that it is causing that >> service processes are put into some kind of sleep mode instead of stopping >> them and starting later. >> From what I heard Erlang runtime does not work well when going into sleep >> mode, some timers work incorrectly then. I was struggling for almost one >> year with RabbitMQ being unresponsive for 2-3h every Monday, now I've found >> that Fast Startup is causing such mess. >> >> Currently I'm trying to find any resources related to Erlang and Fast >> Startup feature, does anybody know something about it? How to avoid such >> issue? Is it possible to provide some kind of fix in order to prevent such >> cases for Windows 10 users? Or at least letting them know that they should >> probably turn this feature off? >> >> >> Regards, >> Przemek D. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Wed May 3 20:32:35 2017 From: kenneth@REDACTED (Kenneth Lundin) Date: Wed, 3 May 2017 20:32:35 +0200 Subject: [erlang-questions] Erlang/OTP will soon be released! In-Reply-To: References: Message-ID: Erlang/OTP 20 rc1 will soon be released! It is slightly delayed, but the plan is on Friday. Looking forward to your feedback. Erlang/OTP, Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Wed May 3 21:43:35 2017 From: g@REDACTED (Guilherme Andrade) Date: Wed, 3 May 2017 20:43:35 +0100 Subject: [erlang-questions] xref and cowboy callbacks In-Reply-To: <20170503090652.7e43b23f706d1a78218bd3e1c66e57ee.efe882be32.wbe@email23.godaddy.com> References: <20170503090652.7e43b23f706d1a78218bd3e1c66e57ee.efe882be32.wbe@email23.godaddy.com> Message-ID: Hi, > But it's also telling me that my cowboy callbacks are unused exports: > > Warning: init_handler:allowed_methods/2 is unused export (Xref) > Warning: init_handler:content_types_accepted/2 is unused export (Xref) > ... Based on the list of callbacks, I'm assuming these are rest handlers. Unfortunately, almost all of the rest handler callback functions are optional[1] and not part of a particular behavior (as of cowboy 1.x, anyway.) As the calling-back itself is done dynamically - either using apply/3 or M:F(A, ...), with M only known at runtime - and the functions are not part of any explicitly defined behavior, there's no way xref can know or assume the callback functions are actually going to be used. I usually use '-ignore_xref({F,Arity})' directives as a workaround. Perhaps defining a cowboy rest handler behavior with all optional callbacks marked as such would do the trick, but if I recall correctly optional callback annotations are a fairly recent feature. Regards, [1]: https://ninenines.eu/docs/en/cowboy/1.0/manual/cowboy_rest/ On 3 May 2017 at 17:06, wrote: > I'm new at using xref and must be missing something obvious. I did some > refactoring of my app and decided to run xref to find where I'd forgot to > delete/add something. It worked great and I found mistakes I'd made and > fixed them, But it's also telling me that my cowboy callbacks are unused > exports: > > Warning: init_handler:allowed_methods/2 is unused export (Xref) > Warning: init_handler:content_types_accepted/2 is unused export (Xref) > Warning: init_handler:handle_json/2 is unused export (Xref) > Warning: init_handler:init/3 is unused export (Xref) > Warning: init_handler:rest_init/2 is unused export (Xref) > Warning: openc2_handler:allowed_methods/2 is unused export (Xref) > Warning: openc2_handler:content_types_accepted/2 is unused export (Xref) > Warning: openc2_handler:handle_json/2 is unused export (Xref) > Warning: openc2_handler:init/3 is unused export (Xref) > Warning: openc2_handler:rest_init/2 is unused export (Xref) > Warning: status_handler:allowed_methods/2 is unused export (Xref) > Warning: status_handler:init/3 is unused export (Xref) > Warning: status_handler:rest_init/2 is unused export (Xref) > Warning: status_handler:to_html/2 is unused export (Xref) > Warning: status_ok_handler:allowed_methods/2 is unused export (Xref) > Warning: status_ok_handler:content_types_provided/2 is unused export > (Xref) > Warning: status_ok_handler:init/3 is unused export (Xref) > > init_handler, openc2_handler, status_handler, and status_ok_handler are > all modules in the cowboy routes: > > Routes = > [ > { > '_' %virtual hostname (any host name) > , [ > {"/status", status_handler, []} > , {"/ok", status_ok_handler, []} % returns ok if service working > , {"/openc2", openc2_handler, []} % handles the meat of openc2 > , {"/init", init_handler, []} % handles starting/restarting the > sim > ] > } > ], > > I assume I'm not configuring xref correctly to let it know about cowboy. I > run xref using rebar 3 from the app directory. I assumed rebar3's knowledge > about dependencies would inform xref (which it must or I'd get a host of > other errors) - but then why do these warnings appear? > > Not sure if related but I also get: > Warning: ocas_app:start/0 is unused export (Xref) > This is the main start routine so I guess it makes sense it isn't called > from anything else. > > Duncan Sparrell > sFractal Consulting LLC > iPhone, iTypo, iApologize > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From vans_163@REDACTED Wed May 3 22:17:54 2017 From: vans_163@REDACTED (Vans S) Date: Wed, 3 May 2017 20:17:54 +0000 (UTC) Subject: [erlang-questions] Erlang/OTP will soon be released! In-Reply-To: References: Message-ID: <927934341.2388353.1493842674811@mail.yahoo.com> Jeez OTP, you snuck up on me. Looking forward to this! On Wednesday, May 3, 2017 2:32 PM, Kenneth Lundin wrote: Erlang/OTP 20 rc1 will soon be released! It is slightly delayed, but the plan is on Friday. Looking forward to your feedback. Erlang/OTP, Ericsson_______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From denc716@REDACTED Thu May 4 01:11:12 2017 From: denc716@REDACTED (derek) Date: Wed, 3 May 2017 16:11:12 -0700 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode Message-ID: I found this feature from some of the merged PRs of Erlang/OTP 20 https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 https://github.com/erlang/otp/pulls?q=unicode > Erlang/OTP 20.0, atoms and function can contain Unicode characters so I built the binary from git checked out source code (from revision efcb91bce) and play with it: it seems in escript interpreting mode it works, but compiling mode still has errors: ? cat ./hello.erl #!/usr/bin/env escript %% -*- coding: utf-8 -*- %%! +pc unicode -module(hello). %-mode(compile). -export([main/1, 'hello_??????_??'/0]). main(_) -> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), % 'hello_'(), io:setopts([{encoding,unicode}]), % io:format("~p~n", [{io:printable_range(), io:getopts()}]), 'hello_??????_??'(), io:format("~tp~n", [{"Hello, ??, ??????"}]). 'hello_??????_??'() -> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, "Hello, ??; ??????"}]). ? erlang20 ./hello.erl {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} {"Hello, ??, ??????"} If I uncomment the "-mode(compile)." line, it just runs into compilation error (same as below shell compilation errors) Or in the Erlang shell, trying to compile it just failed: (I have to remove (or comment out) the first "#!/usr/bin/env escript" line) ? erlang20 Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.0 (abort with ^G) 1> c(hello). hello.erl: internal error in beam_asm; crash reason: badarg in function list_to_binary/1 called as list_to_binary([[5,104,101,108,108,111], [4,109,97,105,110], [2,105,111], [7,115,101,116,111,112,116,115], [6,102,111,114,109,97,116], [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028], "\vmodule_info", [6,101,114,108,97,110,103], [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) in call from beam_asm:chunk/3 (beam_asm.erl, line 213) in call from beam_asm:build_file/8 (beam_asm.erl, line 97) in call from beam_asm:module/4 (beam_asm.erl, line 31) in call from compile:beam_asm/1 (compile.erl, line 1370) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 329) in call from compile:fold_comp/3 (compile.erl, line 355) in call from compile:internal_comp/4 (compile.erl, line 339) error 2> I have looked up in many of the commit messages, still not seeing a good example of how to use unicode in function names? Could some developer behind this feature give more examples? https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Thu May 4 07:16:00 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Thu, 4 May 2017 10:46:00 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> <235992290.65193.1493818071491@webmail.blacklightsw.com> Message-ID: <577749164.16496.1493874960536@webmail.blacklightsw.com> the problem is that not only is it able to find erl and erlc but also empd and other erlang files after i have uninstalled the previous older version of Erlang. It is giving the following errrors: checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a sed that does not truncate output... /bin/sed checking for erl... no checking for erlc... no checking for epmd... no checking for erl... no configure: error: Erlang/OTP interpreter (erl) not found but required and If i don't run the maands after sudo su I get the following errors: [ec2-user@REDACTED ejabberd-17.03]$ ./configure ./configure: line 1529: config.log: Permission denied ./configure: line 1539: config.log: Permission denied But I do want do "set ERLC=$(which erlc) and also set ERL=$(which erl" but how can I set them I have used simple-> set erlc=$(which erlc) set erl=$(which erl) But then also on doing ./configure followed by sudo su gives me the same error of configure: error: Erlang/OTP interpreter (erl) not found but required Please suggest some Ideas > On May 3, 2017 at 7:50 PM Jesper Louis Andersen wrote: > > The ejabberd build script may be a bit weak. > > * try using an explicit path rather than ~/... expand it to /home/ubuntu (or the output of echo ~) in order to make sure you don't get accidentally name expanded as root. > * do not use sudo when building the software. It should build without. > * ./configure --with-erlang=/home/ubuntu/kerl/17.1 or set ERLC=$(which erlc) and also set ERL=$(which erl) > > Configure scripts can *definitely* build without the Erlang being in the default location. It is just a question of coercion. > > On Wed, May 3, 2017 at 3:28 PM Abhishek Ranjan wrote: > > > > I did an uninstall of the previous version of erlang and the ./configure gave following errors > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure > > > > checking whether make sets $(MAKE)... yes > > checking for a BSD-compatible install... /usr/bin/install -c > > checking for a sed that does not truncate output... /bin/sed > > checking for erl... no > > checking for erlc... no > > checking for epmd... no > > > > checking for erl... no > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > and that is why I was suspecting that whenever I run the ./configure command the script goes to > > /usr/bin > > and search for erl ,erlc....etc > > That is why I asked that is there any way that I can set my erl path to /usr/bin which is currently gives that following path on "which erl" > > ~/kerl/17.1/bin/erl > > > > or should I install erlang again. if so can anyone tell me how to make the erl path specifically such that it points to /usr/bin and still the erlang shell works on typing erl alone? > > > > > > > > > > > On May 3, 2017 at 6:25 PM Abhishek Ranjan wrote: > > > > > > No i am still getting the same error and the line > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > is giving the following error too > > > > > > [root@REDACTED ejabberd-17.03]# ./configure ?Bindir=~/home/ec2-user/kerl/ 17.1/bin > > > configure: error: invalid variable name: `?Bindir' > > > > > > Actually it is a amazon aws linux instance and it 's is the only option I have for now. > > > Any Ideas on how to make it work or any ideas on how to install ejabberd 17.03 or higher in this environment. I have already tried the binary installer and it worked at start but it didn't work on second installation. > > > http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws > > > > > > kindly help. > > > > > > > > > > > > > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > > > > this line is wrong .it should be > > > > export PATH=$PATH: ~/kerl/17.1/bin > > > > > > > > also in this step > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > it should be > > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > > > > > also i though you were installing on a fedora box ? > > > > why not try the fedora option for the erlang installation ? > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > > > > > > > > > > > > > I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > Complete scenario went something like this: > > > > > > > > > > [ec2-user@REDACTED ~]$ kerl list builds > > > > > 17.1,erlang-17.1 > > > > > 17.1,erl > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > [ec2-user@REDACTED ~]$ erl > > > > > -bash: erl: command not found > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > No Erlang/OTP kerl installation is currently active > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > The current active installation is: > > > > > /home/ec2-user/kerl/17.1 > > > > > [ec2-user@REDACTED ~]$ erl > > > > > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] > > > > > > > > > > Eshell V6.1 (abort with ^G) > > > > > 1> q(). > > > > > ok > > > > > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > > ./configure: line 1529: config.log: Permission denied > > > > > ./configure: line 1539: config.log: Permission denied > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > aclocal: error: echo failed with exit status: 1 > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > You need to be root to perform this command. > > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > > > > > [root@REDACTED ejabberd-17.03]# yum install automake > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > amzn-main | 2.1 kB 00:00 > > > > > amzn-updates | 2.3 kB 00:00 > > > > > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version > > > > > Nothing to do > > > > > [root@REDACTED ejabberd-17.03]# ./autogen.sh > > > > > [root@REDACTED ejabberd-17.03]# ./configure > > > > > checking whether make sets $(MAKE)... yes > > > > > checking for a BSD-compatible install... /usr/bin/install -c > > > > > checking for a sed that does not truncate output... /bin/sed > > > > > checking for erl... no > > > > > checking for erlc... /usr/bin/erlc > > > > > checking for epmd... /usr/bin/epmd > > > > > checking for erl... no > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > > > > > > > > > > > it is giving me this path "/kerl/17.1/bin/erl" > > > > > > which is actually inside /home/ec2-user/ > > > > > > > > > > > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > > > > > > /home/ec2-user//kerl/17.1/bin/erl > > > > > > > > > > > > So is there any way I can change this path to /usr/bin. > > > > > > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > > > > > > > > > > > @ Ranjan, > > > > > > > > > > > > > > KERL_ENABLE_PROMPT=Y > > > > > > > . ~/kerl/17.1/activate > > > > > > > They are two separate commands not one command. > > > > > > > Run them one after the other . > > > > > > > After that run > > > > > > > which erl > > > > > > > That command will show you the path to your current activated erlang version . > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------- > > > > > > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > > > > > > Sent: ?5/?3/?2017 9:46 AM > > > > > > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > > > > > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > > > > > > > > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > > > > > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > command when I was in this home directory. > > > > > > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > > > > > > and run ./configure command it is giving me this error. > > > > > > > what I understand is the line which you are saying that I missed is the same line as > > > > > > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > > > > > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > > > > > > Can you gauge where I am going wrong exactly > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > > > > > > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > > > > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > > > > > > > > > > > then: ./configure which gave this error > > > > > > > > > > > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > Can anyone help? > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > > > > > Abhishek > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > erlang-questions mailing list > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Jack Tang > > > > > > > > > > > > > > > > > > > > > > > > http://www.linkedin.com/in/jacktang > > > > > > > > _______________________________________________ > > > > > > > > erlang-questions mailing list > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Thu May 4 08:04:48 2017 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Thu, 4 May 2017 08:04:48 +0200 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: Hi derek, I have sent a PR that improves the coverage around this feature: https://github.com/erlang/otp/pull/1439 The test currently passes on an old master reference. I will rebuild my development VM from master and follow up. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Thu, May 4, 2017 at 1:11 AM, derek wrote: > > I found this feature from some of the merged PRs of Erlang/OTP 20 > > https://github.com/erlang/otp/blob/master/lib/stdlib/doc/ > src/unicode_usage.xml#L66-L71 > https://github.com/erlang/otp/pulls?q=unicode > > > Erlang/OTP 20.0, atoms and function can contain Unicode characters > > so I built the binary from git checked out source code (from revision > efcb91bce) and play with it: it seems in escript interpreting mode it > works, but compiling mode still has errors: > > ? cat ./hello.erl > #!/usr/bin/env escript > %% -*- coding: utf-8 -*- > %%! +pc unicode > > -module(hello). > %-mode(compile). > -export([main/1, 'hello_??????_??'/0]). > > main(_) -> > % io:format("~p~n", [{io:printable_range(), io:getopts()}]), > % 'hello_'(), > io:setopts([{encoding,unicode}]), > % io:format("~p~n", [{io:printable_range(), io:getopts()}]), > 'hello_??????_??'(), > io:format("~tp~n", [{"Hello, ??, ??????"}]). > > 'hello_??????_??'() -> > io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, > "Hello, ??; ??????"}]). > > ? erlang20 ./hello.erl > {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} > {"Hello, ??, ??????"} > > If I uncomment the "-mode(compile)." line, it just runs into compilation > error (same as below shell compilation errors) > > Or in the Erlang shell, trying to compile it just failed: (I have to > remove (or comment out) the first "#!/usr/bin/env escript" line) > > ? erlang20 > Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] > [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.0 (abort with ^G) > 1> c(hello). > hello.erl: internal error in beam_asm; > crash reason: badarg > > in function list_to_binary/1 > called as list_to_binary([[5,104,101,108,108,111], > [4,109,97,105,110], > [2,105,111], > [7,115,101,116,111,112,116,115], > [6,102,111,114,109,97,116], > [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076, > 95,19990,30028], > "\vmodule_info", > [6,101,114,108,97,110,103], > [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) > in call from beam_asm:chunk/3 (beam_asm.erl, line 213) > in call from beam_asm:build_file/8 (beam_asm.erl, line 97) > in call from beam_asm:module/4 (beam_asm.erl, line 31) > in call from compile:beam_asm/1 (compile.erl, line 1370) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, > line 329) > in call from compile:fold_comp/3 (compile.erl, line 355) > in call from compile:internal_comp/4 (compile.erl, line 339) > error > 2> > > I have looked up in many of the commit messages, still not seeing a good > example of how to use unicode in function names? Could some developer > behind this feature give more examples? > https://github.com/erlang/otp/blame/master/lib/stdlib/doc/ > src/unicode_usage.xml#L66-L71 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Thu May 4 09:06:54 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Thu, 4 May 2017 12:36:54 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <577749164.16496.1493874960536@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> <235992290.65193.1493818071491@webmail.blacklightsw.com> <577749164.16496.1493874960536@webmail.blacklightsw.com> Message-ID: <1936439728.27759.1493881614867@webmail.blacklightsw.com> hi I have been trying different things regarding this problem and seems like I have solve the problem of checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a sed that does not truncate output... /bin/sed checking for erl... no checking for erlc... no checking for epmd... no checking for erl... no configure: error: Erlang/OTP interpreter (erl) not found but required and now it worked fine when I execute ./configure command. But I have been following this link for ejabberd's installation: https://www.aurigait.com/blog/how-to-setup-ejabbered-on-ubuntu and in here(the link) in the step 4 i have sucessfully gone through the configure command but when I am running make command it breaks like this: ==> fast_xml (compile) Compiled src/fxml_gen_pt.erl Compiled src/fxml_sup.erl Compiled src/fxml.erl Compiled src/fxml_stream.erl Compiled src/fxmlrpc.erl Compiled src/fast_xml.erl Compiled src/fxmlrpc_codec.erl Compiled src/fxml_gen.erl Compiling c_src/fxml.c Compiling /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c _src/fxml_stream.c /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c_src/fxml_ stream.c:21:19: fatal error: expat.h: No such file or directory #include ^ compilation terminated. ERROR: compile failed while processing /home/ec2-user/downloads/ejabberd-17.03/e jabberd-17.03/deps/fast_xml: rebar_abort make: *** [deps/.built] Error 1 what does it means by fatal error expat.h not found in directory. I was just following the steps then where did it went wrong? Any Idea? Please Share. > On May 4, 2017 at 10:46 AM Abhishek Ranjan wrote: > > the problem is that not only is it able to find erl and erlc but also empd and other erlang files after i have uninstalled the previous older version of Erlang. It is giving the following errrors: > checking whether make sets $(MAKE)... yes > checking for a BSD-compatible install... /usr/bin/install -c > checking for a sed that does not truncate output... /bin/sed > checking for erl... no > checking for erlc... no > checking for epmd... no > checking for erl... no > configure: error: Erlang/OTP interpreter (erl) not found but required > > and If i don't run the maands after sudo su I get the following errors: > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > ./configure: line 1529: config.log: Permission denied > ./configure: line 1539: config.log: Permission denied > > But I do want do "set ERLC=$(which erlc) and also set ERL=$(which erl" > but how can I set them > I have used simple-> set erlc=$(which erlc) > set erl=$(which erl) > But then also on doing ./configure followed by sudo su gives me the same error of > configure: error: Erlang/OTP interpreter (erl) not found but required > > Please suggest some Ideas > > > > > On May 3, 2017 at 7:50 PM Jesper Louis Andersen wrote: > > > > The ejabberd build script may be a bit weak. > > > > * try using an explicit path rather than ~/... expand it to /home/ubuntu (or the output of echo ~) in order to make sure you don't get accidentally name expanded as root. > > * do not use sudo when building the software. It should build without. > > * ./configure --with-erlang=/home/ubuntu/kerl/17.1 or set ERLC=$(which erlc) and also set ERL=$(which erl) > > > > Configure scripts can *definitely* build without the Erlang being in the default location. It is just a question of coercion. > > > > On Wed, May 3, 2017 at 3:28 PM Abhishek Ranjan wrote: > > > > > > > I did an uninstall of the previous version of erlang and the ./configure gave following errors > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure > > > > > > checking whether make sets $(MAKE)... yes > > > checking for a BSD-compatible install... /usr/bin/install -c > > > checking for a sed that does not truncate output... /bin/sed > > > checking for erl... no > > > checking for erlc... no > > > checking for epmd... no > > > > > > checking for erl... no > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > and that is why I was suspecting that whenever I run the ./configure command the script goes to > > > /usr/bin > > > and search for erl ,erlc....etc > > > That is why I asked that is there any way that I can set my erl path to /usr/bin which is currently gives that following path on "which erl" > > > ~/kerl/17.1/bin/erl > > > > > > or should I install erlang again. if so can anyone tell me how to make the erl path specifically such that it points to /usr/bin and still the erlang shell works on typing erl alone? > > > > > > > > > > > > > > > > On May 3, 2017 at 6:25 PM Abhishek Ranjan wrote: > > > > > > > > No i am still getting the same error and the line > > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > is giving the following error too > > > > > > > > [root@REDACTED ejabberd-17.03]# ./configure ?Bindir=~/home/ec2-user/kerl/ 17.1/bin > > > > configure: error: invalid variable name: `?Bindir' > > > > > > > > Actually it is a amazon aws linux instance and it 's is the only option I have for now. > > > > Any Ideas on how to make it work or any ideas on how to install ejabberd 17.03 or higher in this environment. I have already tried the binary installer and it worked at start but it didn't work on second installation. > > > > http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws > > > > > > > > kindly help. > > > > > > > > > > > > > > > > > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > > > > > > this line is wrong .it should be > > > > > export PATH=$PATH: ~/kerl/17.1/bin > > > > > > > > > > also in this step > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > > it should be > > > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > > > > > > > also i though you were installing on a fedora box ? > > > > > why not try the fedora option for the erlang installation ? > > > > > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > Complete scenario went something like this: > > > > > > > > > > > > [ec2-user@REDACTED ~]$ kerl list builds > > > > > > 17.1,erlang-17.1 > > > > > > 17.1,erl > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > > > > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > [ec2-user@REDACTED ~]$ erl > > > > > > -bash: erl: command not found > > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > > No Erlang/OTP kerl installation is currently active > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > > The current active installation is: > > > > > > /home/ec2-user/kerl/17.1 > > > > > > [ec2-user@REDACTED ~]$ erl > > > > > > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] > > > > > > > > > > > > Eshell V6.1 (abort with ^G) > > > > > > 1> q(). > > > > > > ok > > > > > > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > > > > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > > > ./configure: line 1529: config.log: Permission denied > > > > > > ./configure: line 1539: config.log: Permission denied > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > > aclocal: error: echo failed with exit status: 1 > > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > > You need to be root to perform this command. > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > > > > > > [root@REDACTED ejabberd-17.03]# yum install automake > > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > > amzn-main | 2.1 kB 00:00 > > > > > > amzn-updates | 2.3 kB 00:00 > > > > > > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version > > > > > > Nothing to do > > > > > > [root@REDACTED ejabberd-17.03]# ./autogen.sh > > > > > > [root@REDACTED ejabberd-17.03]# ./configure > > > > > > checking whether make sets $(MAKE)... yes > > > > > > checking for a BSD-compatible install... /usr/bin/install -c > > > > > > checking for a sed that does not truncate output... /bin/sed > > > > > > checking for erl... no > > > > > > checking for erlc... /usr/bin/erlc > > > > > > checking for epmd... /usr/bin/epmd > > > > > > checking for erl... no > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > > > > > > > > > > > > > it is giving me this path "/kerl/17.1/bin/erl" > > > > > > > which is actually inside /home/ec2-user/ > > > > > > > > > > > > > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > > > > > > > /home/ec2-user//kerl/17.1/bin/erl > > > > > > > > > > > > > > So is there any way I can change this path to /usr/bin. > > > > > > > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > > > > > > > > > > > > > @ Ranjan, > > > > > > > > > > > > > > > > KERL_ENABLE_PROMPT=Y > > > > > > > > . ~/kerl/17.1/activate > > > > > > > > They are two separate commands not one command. > > > > > > > > Run them one after the other . > > > > > > > > After that run > > > > > > > > which erl > > > > > > > > That command will show you the path to your current activated erlang version . > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------- > > > > > > > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > > > > > > > Sent: ?5/?3/?2017 9:46 AM > > > > > > > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > > > > > > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > > > > > > > > > > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > > > > > > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > > command when I was in this home directory. > > > > > > > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > > > > > > > and run ./configure command it is giving me this error. > > > > > > > > what I understand is the line which you are saying that I missed is the same line as > > > > > > > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > > > > > > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > > > > > > > Can you gauge where I am going wrong exactly > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > > > > > > > > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > > > > > > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > > > > > > > > > > > > > then: ./configure which gave this error > > > > > > > > > > > > > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > > > Can anyone help? > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > > > > > > > Abhishek > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > Jack Tang > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.linkedin.com/in/jacktang > > > > > > > > > _______________________________________________ > > > > > > > > > erlang-questions mailing list > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > erlang-questions mailing list > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED mailto: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 leonard.boyce@REDACTED Thu May 4 12:16:19 2017 From: leonard.boyce@REDACTED (Leonard B) Date: Thu, 4 May 2017 06:16:19 -0400 Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: <1936439728.27759.1493881614867@webmail.blacklightsw.com> References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> <235992290.65193.1493818071491@webmail.blacklightsw.com> <577749164.16496.1493874960536@webmail.blacklightsw.com> <1936439728.27759.1493881614867@webmail.blacklightsw.com> Message-ID: Apologies for the top post. It seems to me that your primary problem is you're activating/setting path for your normal user, then su to root. root does not have the path for erl set, which is why it cannot find anything. Try adding path to erl to root's PATH. Leonard On May 4, 2017 03:07, "Abhishek Ranjan" wrote: > hi > I have been trying different things regarding this problem and seems like > I have solve the problem of > checking whether make sets $(MAKE)... yes > checking for a BSD-compatible install... /usr/bin/install -c > checking for a sed that does not truncate output... /bin/sed > checking for erl... no > checking for erlc... no > checking for epmd... no > checking for erl... no > configure: error: Erlang/OTP interpreter (erl) not found but required > > and now it worked fine when I execute ./configure command. But I have been > following this link for ejabberd's installation: > https://www.aurigait.com/blog/how-to-setup-ejabbered-on-ubuntu > > and in here(the link) in the step 4 i have sucessfully gone through the > configure command but when I am running make command it breaks like this: > > ==> fast_xml (compile) > Compiled src/fxml_gen_pt.erl > Compiled src/fxml_sup.erl > Compiled src/fxml.erl > Compiled src/fxml_stream.erl > Compiled src/fxmlrpc.erl > Compiled src/fast_xml.erl > Compiled src/fxmlrpc_codec.erl > Compiled src/fxml_gen.erl > Compiling c_src/fxml.c > Compiling /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c > _src/fxml_stream.c > /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c_src/fxml_ > stream.c:21:19: fatal error: expat.h: No such file or directory > #include > ^ > compilation terminated. > ERROR: compile failed while processing /home/ec2-user/downloads/ejabberd-17.03/e > jabberd-17.03/deps/fast_xml: rebar_abort > make: *** [deps/.built] Error 1 > > what does it means by fatal error expat.h not found in directory. I was > just following the steps then where did it went wrong? > > Any Idea? > Please Share. > > On May 4, 2017 at 10:46 AM Abhishek Ranjan > wrote: > > the problem is that not only is it able to find erl and erlc but also empd > and other erlang files after i have uninstalled the previous older version > of Erlang. It is giving the following errrors: > checking whether make sets $(MAKE)... yes > checking for a BSD-compatible install... /usr/bin/install -c > checking for a sed that does not truncate output... /bin/sed > checking for erl... no > checking for erlc... no > checking for epmd... no > checking for erl... no > configure: error: Erlang/OTP interpreter (erl) not found but required > > and If i don't run the maands after sudo su I get the following errors: > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > ./configure: line 1529: config.log: Permission denied > ./configure: line 1539: config.log: Permission denied > > But I do want do "set ERLC=$(which erlc) and also set ERL=$(which erl" > but how can I set them > I have used simple-> set erlc=$(which erlc) > set erl=$(which erl) > But then also on doing ./configure followed by sudo su gives me the same > error of > configure: error: Erlang/OTP interpreter (erl) not found but required > > Please suggest some Ideas > > On May 3, 2017 at 7:50 PM Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > > The ejabberd build script may be a bit weak. > > * try using an explicit path rather than ~/... expand it to /home/ubuntu > (or the output of echo ~) in order to make sure you don't get accidentally > name expanded as root. > * do not use sudo when building the software. It should build without. > * ./configure --with-erlang=/home/ubuntu/kerl/17.1 or set ERLC=$(which > erlc) and also set ERL=$(which erl) > > Configure scripts can *definitely* build without the Erlang being in the > default location. It is just a question of coercion. > > On Wed, May 3, 2017 at 3:28 PM Abhishek Ranjan > wrote: > >> I did an uninstall of the previous version of erlang and the ./configure >> gave following errors >> >> [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure >> >> checking whether make sets $(MAKE)... yes >> checking for a BSD-compatible install... /usr/bin/install -c >> checking for a sed that does not truncate output... /bin/sed >> checking for erl... no >> checking for erlc... no >> checking for epmd... no >> >> checking for erl... no >> configure: error: Erlang/OTP interpreter (erl) not found but required >> >> and that is why I was suspecting that whenever I run the ./configure >> command the script goes to >> /usr/bin >> and search for erl ,erlc....etc >> That is why I asked that is there any way that I can set my erl path to >> /usr/bin which is currently gives that following path on "which erl" >> ~/kerl/17.1/bin/erl >> >> or should I install erlang again. if so can anyone tell me how to make >> the erl path specifically such that it points to /usr/bin and still the >> erlang shell works on typing erl alone? >> >> >> On May 3, 2017 at 6:25 PM Abhishek Ranjan >> wrote: >> >> No i am still getting the same error and the line >> ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin >> is giving the following error too >> >> [root@REDACTED ejabberd-17.03]# ./configure >> ?Bindir=~/home/ec2-user/kerl/ 17.1/bin >> configure: error: invalid variable name: `?Bindir' >> >> Actually it is a amazon aws linux instance and it 's is the only option I >> have for now. >> Any Ideas on how to make it work or any ideas on how to install ejabberd >> 17.03 or higher in this environment. I have already tried the binary >> installer and it worked at start but it didn't work on second installation. >> http://stackoverflow.com/questions/43754066/issue-with- >> ejabberds-installation-on-amazon-aws >> >> kindly help. >> >> On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: >> >> [ec2-user@REDACTED ~]$ *export PATH=$PATH: ~/kerl/17.1/bin/erl* >> >> this line is wrong .it should be >> * export PATH=$PATH: ~/kerl/17.1/bin* >> >> also in this step >> [ec2-user@REDACTED ejabberd-17.03]$ *./configure* >> it should be >> * ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin* >> >> also i though you were installing on a fedora box ? >> why not try the fedora option for the erlang installation ? >> >> >> >> On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan < >> abhishek@REDACTED> wrote: >> >>> I actually followed it apart from the export command so after using >>> export path command also the error still pops up that -> configure: error: >>> Erlang/OTP interpreter (erl) not found but required >>> Complete scenario went something like this: >>> >>> [ec2-user@REDACTED ~]$ kerl list builds >>> 17.1,erlang-17.1 >>> 17.1,erl >>> [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl >>> -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid >>> identifier >>> >>> [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/ >>> kerl/17.1/bin/erl >>> [ec2-user@REDACTED ~]$ erl >>> -bash: erl: command not found >>> [ec2-user@REDACTED ~]$ kerl active >>> No Erlang/OTP kerl installation is currently active >>> [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/ >>> kerl/17.1/bin/erl >>> >>> >>> [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate >>> [ec2-user@REDACTED ~]$ kerl active >>> The current active installation is: >>> /home/ec2-user/kerl/17.1 >>> [ec2-user@REDACTED ~]$ erl >>> Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] >>> [kernel-poll:false] >>> >>> Eshell V6.1 (abort with ^G) >>> 1> q(). >>> ok >>> 2> [ec2-user@REDACTED ~]$ cd downloads/ >>> >>> [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ >>> [ec2-user@REDACTED ejabberd-17.03]$ ./configure >>> ./configure: line 1529: config.log: Permission denied >>> ./configure: line 1539: config.log: Permission denied >>> [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh >>> autom4te: cannot open autom4te.cache/requests: Permission denied >>> aclocal: error: echo failed with exit status: 1 >>> autom4te: cannot open autom4te.cache/requests: Permission denied >>> [ec2-user@REDACTED ejabberd-17.03]$ yum install automake >>> Loaded plugins: priorities, update-motd, upgrade-helper >>> You need to be root to perform this command. >>> [ec2-user@REDACTED ejabberd-17.03]$ sudo su >>> [root@REDACTED ejabberd-17.03]# yum install automake >>> Loaded plugins: priorities, update-motd, upgrade-helper >>> amzn-main | 2.1 kB 00:00 >>> amzn-updates | 2.3 kB 00:00 >>> Package automake-1.13.4-3.15.amzn1.noarch already installed and latest >>> version >>> Nothing to do >>> [root@REDACTED ejabberd-17.03]# ./autogen.sh >>> [root@REDACTED ejabberd-17.03]# ./configure >>> checking whether make sets $(MAKE)... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking for a sed that does not truncate output... /bin/sed >>> checking for erl... no >>> checking for erlc... /usr/bin/erlc >>> checking for epmd... /usr/bin/epmd >>> checking for erl... no >>> configure: error: Erlang/OTP interpreter (erl) not found but required >>> >>> On May 3, 2017 at 4:17 PM Abhishek Ranjan >>> wrote: >>> >>> it is giving me this path "/kerl/17.1/bin/erl" >>> which is actually inside /home/ec2-user/ >>> >>> what I feel is that this erl should have been inside /usr/bin/ directory >>> and instead it is inside >>> /home/ec2-user//kerl/17.1/bin/erl >>> >>> So is there any way I can change this path to /usr/bin. >>> Please tell me if I am thinking right first and if so how can this be >>> done in linux(amazon linux or fedora). >>> >>> On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: >>> >>> @ Ranjan, >>> >>> KERL_ENABLE_PROMPT=Y >>> . ~/kerl/17.1/activate >>> They are two separate commands not one command. >>> Run them one after the other . >>> After that run >>> which erl >>> That command will show you the path to your current activated erlang >>> version . >>> >>> >>> ------------------------------ >>> From: Abhishek Ranjan >>> Sent: ?5/?3/?2017 9:46 AM >>> To: Jack Tang ; Erlang-Questions Questions >>> >>> Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found >>> butrequired >>> >>> home/ec2-user is my home directory or should I say the default directory >>> when I make the ssh connection to server. >>> so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate >>> command when I was in this home directory. >>> I think I missed a trick here as I am not familiar with linux and how to >>> set path in linux and that's why maybe when I go to home/ec2-user/download/ >>> ejabberd.17.03/ >>> and run ./configure command it is giving me this error. >>> what I understand is the line which you are saying that I missed is the >>> same line as >>> KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate >>> but may be I gave a wrong path or ran it from wrong place >>> (home/ec2-user). >>> I followed: https://yrsdi.github.io/programming/setup-erlang-with- >>> kerl-mac-osx/ >>> Can you gauge where I am going wrong exactly >>> >>> On May 3, 2017 at 3:06 PM Jack Tang wrote: >>> >>> You might miss to run `$ . /path/to/install/dir/activate`. >>> >>> On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan < >>> abhishek@REDACTED> wrote: >>> >>>> I was installing ejabberd 17.03 through source code when I found that I >>>> needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using >>>> kerl inside the /home/ec2-user/kerl/17.1 directory. >>>> >>>> I then used ./autogen.sh command which ran without any output >>>> >>>> then: ./configure which gave this error >>>> >>>> configure: error: Erlang/OTP interpreter (erl) not found but required >>>> >>>> Can anyone help? >>>> >>>> Regards, >>>> >>>> Abhishek >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> >>> -- >>> Jack Tang >>> >>> >>> http://www.linkedin.com/in/jacktang >>> _______________________________________________ >>> 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 >> > > > > > > > _______________________________________________ > 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.valim@REDACTED Thu May 4 12:36:10 2017 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Thu, 4 May 2017 12:36:10 +0200 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: I have rebuilt Erlang from master and both the test and the code snippet you sent by e-mail works. In order to discard any encoding issue in the process, can you please push your code snippets to a repository? *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Thu, May 4, 2017 at 8:04 AM, Jos? Valim wrote: > Hi derek, > > I have sent a PR that improves the coverage around this feature: > https://github.com/erlang/otp/pull/1439 > > The test currently passes on an old master reference. I will rebuild my > development VM from master and follow up. > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, May 4, 2017 at 1:11 AM, derek wrote: > >> >> I found this feature from some of the merged PRs of Erlang/OTP 20 >> >> https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src >> /unicode_usage.xml#L66-L71 >> https://github.com/erlang/otp/pulls?q=unicode >> >> > Erlang/OTP 20.0, atoms and function can contain Unicode characters >> >> so I built the binary from git checked out source code (from revision >> efcb91bce) and play with it: it seems in escript interpreting mode it >> works, but compiling mode still has errors: >> >> ? cat ./hello.erl >> #!/usr/bin/env escript >> %% -*- coding: utf-8 -*- >> %%! +pc unicode >> >> -module(hello). >> %-mode(compile). >> -export([main/1, 'hello_??????_??'/0]). >> >> main(_) -> >> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >> % 'hello_'(), >> io:setopts([{encoding,unicode}]), >> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >> 'hello_??????_??'(), >> io:format("~tp~n", [{"Hello, ??, ??????"}]). >> >> 'hello_??????_??'() -> >> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, >> "Hello, ??; ??????"}]). >> >> ? erlang20 ./hello.erl >> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} >> {"Hello, ??, ??????"} >> >> If I uncomment the "-mode(compile)." line, it just runs into compilation >> error (same as below shell compilation errors) >> >> Or in the Erlang shell, trying to compile it just failed: (I have to >> remove (or comment out) the first "#!/usr/bin/env escript" line) >> >> ? erlang20 >> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] >> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V9.0 (abort with ^G) >> 1> c(hello). >> hello.erl: internal error in beam_asm; >> crash reason: badarg >> >> in function list_to_binary/1 >> called as list_to_binary([[5,104,101,108,108,111], >> [4,109,97,105,110], >> [2,105,111], >> [7,115,101,116,111,112,116,115], >> [6,102,111,114,109,97,116], >> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95, >> 19990,30028], >> "\vmodule_info", >> [6,101,114,108,97,110,103], >> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) >> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) >> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) >> in call from beam_asm:module/4 (beam_asm.erl, line 31) >> in call from compile:beam_asm/1 (compile.erl, line 1370) >> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, >> line 329) >> in call from compile:fold_comp/3 (compile.erl, line 355) >> in call from compile:internal_comp/4 (compile.erl, line 339) >> error >> 2> >> >> I have looked up in many of the commit messages, still not seeing a good >> example of how to use unicode in function names? Could some developer >> behind this feature give more examples? >> https://github.com/erlang/otp/blame/master/lib/stdlib/doc/sr >> c/unicode_usage.xml#L66-L71 >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Thu May 4 15:02:59 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Thu, 4 May 2017 18:32:59 +0530 (IST) Subject: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired In-Reply-To: References: <530791490.42017.1493803366646@webmail.blacklightsw.com> <1469879516.44178.1493804761921@webmail.blacklightsw.com> <5909b1b5.89aadf0a.1969a.b088@mx.google.com> <1369425332.50059.1493808431077@webmail.blacklightsw.com> <1107624129.54733.1493811316572@webmail.blacklightsw.com> <1773357768.62619.1493816133328@webmail.blacklightsw.com> <235992290.65193.1493818071491@webmail.blacklightsw.com> <577749164.16496.1493874960536@webmail.blacklightsw.com> <1936439728.27759.1493881614867@webmail.blacklightsw.com> Message-ID: <1320577445.63346.1493902979432@webmail.blacklightsw.com> yes I figured out that I was in my home directory and installing stuff that's what made problems. Went to root,followed the steps which were missing some steps in between on each link I went through but in the end by combining them and using them I managed to install ejabberd 17.03 from source. Thank you very much for the help. Regards, Abhishek > On May 4, 2017 at 3:46 PM Leonard B wrote: > > Apologies for the top post. > > It seems to me that your primary problem is you're activating/setting path for your normal user, then su to root. root does not have the path for erl set, which is why it cannot find anything. > > Try adding path to erl to root's PATH. > > Leonard > > On May 4, 2017 03:07, "Abhishek Ranjan" wrote: > > > > hi > > I have been trying different things regarding this problem and seems like I have solve the problem of > > checking whether make sets $(MAKE)... yes > > checking for a BSD-compatible install... /usr/bin/install -c > > checking for a sed that does not truncate output... /bin/sed > > checking for erl... no > > checking for erlc... no > > checking for epmd... no > > checking for erl... no > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > and now it worked fine when I execute ./configure command. But I have been following this link for ejabberd's installation: > > https://www.aurigait.com/blog/how-to-setup-ejabbered-on-ubuntu https://www.aurigait.com/blog/how-to-setup-ejabbered-on-ubuntu > > > > and in here(the link) in the step 4 i have sucessfully gone through the configure command but when I am running make command it breaks like this: > > > > ==> fast_xml (compile) > > Compiled src/fxml_gen_pt.erl > > Compiled src/fxml_sup.erl > > Compiled src/fxml.erl > > Compiled src/fxml_stream.erl > > Compiled src/fxmlrpc.erl > > Compiled src/fast_xml.erl > > Compiled src/fxmlrpc_codec.erl > > Compiled src/fxml_gen.erl > > Compiling c_src/fxml.c > > Compiling /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c _src/fxml_stream.c > > /home/ec2-user/downloads/ejabberd-17.03/ejabberd-17.03/deps/fast_xml/c_src/fxml_ stream.c:21:19: fatal error: expat.h: No such file or directory > > #include > > ^ > > compilation terminated. > > ERROR: compile failed while processing /home/ec2-user/downloads/ejabberd-17.03/e jabberd-17.03/deps/fast_xml: rebar_abort > > make: *** [deps/.built] Error 1 > > > > what does it means by fatal error expat.h not found in directory. I was just following the steps then where did it went wrong? > > > > Any Idea? > > Please Share. > > > > > > > > > On May 4, 2017 at 10:46 AM Abhishek Ranjan wrote: > > > > > > the problem is that not only is it able to find erl and erlc but also empd and other erlang files after i have uninstalled the previous older version of Erlang. It is giving the following errrors: > > > checking whether make sets $(MAKE)... yes > > > checking for a BSD-compatible install... /usr/bin/install -c > > > checking for a sed that does not truncate output... /bin/sed > > > checking for erl... no > > > checking for erlc... no > > > checking for epmd... no > > > checking for erl... no > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > and If i don't run the maands after sudo su I get the following errors: > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > ./configure: line 1529: config.log: Permission denied > > > ./configure: line 1539: config.log: Permission denied > > > > > > But I do want do "set ERLC=$(which erlc) and also set ERL=$(which erl" > > > but how can I set them > > > I have used simple-> set erlc=$(which erlc) > > > set erl=$(which erl) > > > But then also on doing ./configure followed by sudo su gives me the same error of > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > Please suggest some Ideas > > > > > > > > > > > > > On May 3, 2017 at 7:50 PM Jesper Louis Andersen wrote: > > > > > > > > The ejabberd build script may be a bit weak. > > > > > > > > * try using an explicit path rather than ~/... expand it to /home/ubuntu (or the output of echo ~) in order to make sure you don't get accidentally name expanded as root. > > > > * do not use sudo when building the software. It should build without. > > > > * ./configure --with-erlang=/home/ubuntu/kerl/17.1 or set ERLC=$(which erlc) and also set ERL=$(which erl) > > > > > > > > Configure scripts can *definitely* build without the Erlang being in the default location. It is just a question of coercion. > > > > > > > > On Wed, May 3, 2017 at 3:28 PM Abhishek Ranjan wrote: > > > > > > > > > > > > > I did an uninstall of the previous version of erlang and the ./configure gave following errors > > > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo ./configure > > > > > > > > > > checking whether make sets $(MAKE)... yes > > > > > checking for a BSD-compatible install... /usr/bin/install -c > > > > > checking for a sed that does not truncate output... /bin/sed > > > > > checking for erl... no > > > > > checking for erlc... no > > > > > checking for epmd... no > > > > > > > > > > checking for erl... no > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > and that is why I was suspecting that whenever I run the ./configure command the script goes to > > > > > /usr/bin > > > > > and search for erl ,erlc....etc > > > > > That is why I asked that is there any way that I can set my erl path to /usr/bin which is currently gives that following path on "which erl" > > > > > ~/kerl/17.1/bin/erl > > > > > > > > > > or should I install erlang again. if so can anyone tell me how to make the erl path specifically such that it points to /usr/bin and still the erlang shell works on typing erl alone? > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 6:25 PM Abhishek Ranjan wrote: > > > > > > > > > > > > No i am still getting the same error and the line > > > > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > > > is giving the following error too > > > > > > > > > > > > [root@REDACTED ejabberd-17.03]# ./configure ?Bindir=~/home/ec2-user/kerl/ 17.1/bin > > > > > > configure: error: invalid variable name: `?Bindir' > > > > > > > > > > > > Actually it is a amazon aws linux instance and it 's is the only option I have for now. > > > > > > Any Ideas on how to make it work or any ideas on how to install ejabberd 17.03 or higher in this environment. I have already tried the binary installer and it worked at start but it didn't work on second installation. > > > > > > http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws http://stackoverflow.com/questions/43754066/issue-with-ejabberds-installation-on-amazon-aws > > > > > > > > > > > > kindly help. > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 5:45 PM Nuku Ameyibor wrote: > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > > > > > > > > > > this line is wrong .it should be > > > > > > > export PATH=$PATH: ~/kerl/17.1/bin > > > > > > > > > > > > > > also in this step > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > > > > it should be > > > > > > > ./configure ?bindir=~/home/ec2-user/kerl/17.1/bin > > > > > > > > > > > > > > also i though you were installing on a fedora box ? > > > > > > > why not try the fedora option for the erlang installation ? > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 11:35 AM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > I actually followed it apart from the export command so after using export path command also the error still pops up that -> configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > Complete scenario went something like this: > > > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ kerl list builds > > > > > > > > 17.1,erlang-17.1 > > > > > > > > 17.1,erl > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH: ~/kerl/17.1/bin/erl > > > > > > > > -bash: export: `/home/ec2-user/kerl/17.1/bin/erl': not a valid identifier > > > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > > > [ec2-user@REDACTED ~]$ erl > > > > > > > > -bash: erl: command not found > > > > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > > > > No Erlang/OTP kerl installation is currently active > > > > > > > > [ec2-user@REDACTED ~]$ export PATH=$PATH:~/home/ec2-user/kerl/17.1/bin/erl > > > > > > > > > > > > > > > > > > > > > > > > [ec2-user@REDACTED ~]$ . ~/kerl/17.1/activate > > > > > > > > [ec2-user@REDACTED ~]$ kerl active > > > > > > > > The current active installation is: > > > > > > > > /home/ec2-user/kerl/17.1 > > > > > > > > [ec2-user@REDACTED ~]$ erl > > > > > > > > Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > Eshell V6.1 (abort with ^G) > > > > > > > > 1> q(). > > > > > > > > ok > > > > > > > > 2> [ec2-user@REDACTED ~]$ cd downloads/ > > > > > > > > > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ cd ejabberd-17.03/ > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./configure > > > > > > > > ./configure: line 1529: config.log: Permission denied > > > > > > > > ./configure: line 1539: config.log: Permission denied > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ ./autogen.sh > > > > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > > > > aclocal: error: echo failed with exit status: 1 > > > > > > > > autom4te: cannot open autom4te.cache/requests: Permission denied > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ yum install automake > > > > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > > > > You need to be root to perform this command. > > > > > > > > [ec2-user@REDACTED ejabberd-17.03]$ sudo su > > > > > > > > [root@REDACTED ejabberd-17.03]# yum install automake > > > > > > > > Loaded plugins: priorities, update-motd, upgrade-helper > > > > > > > > amzn-main | 2.1 kB 00:00 > > > > > > > > amzn-updates | 2.3 kB 00:00 > > > > > > > > Package automake-1.13.4-3.15.amzn1.noarch already installed and latest version > > > > > > > > Nothing to do > > > > > > > > [root@REDACTED ejabberd-17.03]# ./autogen.sh > > > > > > > > [root@REDACTED ejabberd-17.03]# ./configure > > > > > > > > checking whether make sets $(MAKE)... yes > > > > > > > > checking for a BSD-compatible install... /usr/bin/install -c > > > > > > > > checking for a sed that does not truncate output... /bin/sed > > > > > > > > checking for erl... no > > > > > > > > checking for erlc... /usr/bin/erlc > > > > > > > > checking for epmd... /usr/bin/epmd > > > > > > > > checking for erl... no > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:17 PM Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > it is giving me this path "/kerl/17.1/bin/erl" > > > > > > > > > which is actually inside /home/ec2-user/ > > > > > > > > > > > > > > > > > > what I feel is that this erl should have been inside /usr/bin/ directory and instead it is inside > > > > > > > > > /home/ec2-user//kerl/17.1/bin/erl > > > > > > > > > > > > > > > > > > So is there any way I can change this path to /usr/bin. > > > > > > > > > Please tell me if I am thinking right first and if so how can this be done in linux(amazon linux or fedora). > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 4:01 PM Nuku Ameyibor wrote: > > > > > > > > > > > > > > > > > > > > @ Ranjan, > > > > > > > > > > > > > > > > > > > > KERL_ENABLE_PROMPT=Y > > > > > > > > > > . ~/kerl/17.1/activate > > > > > > > > > > They are two separate commands not one command. > > > > > > > > > > Run them one after the other . > > > > > > > > > > After that run > > > > > > > > > > which erl > > > > > > > > > > That command will show you the path to your current activated erlang version . > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------- > > > > > > > > > > From: Abhishek Ranjan mailto:abhishek@REDACTED > > > > > > > > > > Sent: ?5/?3/?2017 9:46 AM > > > > > > > > > > To: Jack Tang mailto:himars@REDACTED ; Erlang-Questions Questions mailto:erlang-questions@REDACTED > > > > > > > > > > Subject: Re: [erlang-questions] Erlang/OTP interpreter (erl) not found butrequired > > > > > > > > > > > > > > > > > > > > home/ec2-user is my home directory or should I say the default directory when I make the ssh connection to server. > > > > > > > > > > so i ran : KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > > > > command when I was in this home directory. > > > > > > > > > > I think I missed a trick here as I am not familiar with linux and how to set path in linux and that's why maybe when I go to home/ec2-user/download/ejabberd.17.03/ > > > > > > > > > > and run ./configure command it is giving me this error. > > > > > > > > > > what I understand is the line which you are saying that I missed is the same line as > > > > > > > > > > KERL_ENABLE_PROMPT=y . ~/kerl/17.1/activate > > > > > > > > > > but may be I gave a wrong path or ran it from wrong place (home/ec2-user). > > > > > > > > > > I followed: https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ https://yrsdi.github.io/programming/setup-erlang-with-kerl-mac-osx/ > > > > > > > > > > Can you gauge where I am going wrong exactly > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On May 3, 2017 at 3:06 PM Jack Tang wrote: > > > > > > > > > > > > > > > > > > > > > > You might miss to run `$ . /path/to/install/dir/activate`. > > > > > > > > > > > > > > > > > > > > > > On Wed, May 3, 2017 at 5:22 PM, Abhishek Ranjan wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I was installing ejabberd 17.03 through source code when I found that I needed to intall Erlang 17.1 for it. I installed erlang /otp 17.1 using kerl inside the /home/ec2-user/kerl/17.1 directory. > > > > > > > > > > > > > > > > > > > > > > > > I then used ./autogen.sh command which ran without any output > > > > > > > > > > > > > > > > > > > > > > > > then: ./configure which gave this error > > > > > > > > > > > > > > > > > > > > > > > > configure: error: Erlang/OTP interpreter (erl) not found but required > > > > > > > > > > > > > > > > > > > > > > > > Can anyone help? > > > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > > > > > > > > > > > Abhishek > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > Jack Tang > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.linkedin.com/in/jacktang http://www.linkedin.com/in/jacktang > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > erlang-questions mailing list > > > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > erlang-questions mailing list > > > > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list > > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > erlang-questions mailing list > > > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED mailto:erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denc716@REDACTED Thu May 4 23:23:28 2017 From: denc716@REDACTED (derek) Date: Thu, 04 May 2017 21:23:28 +0000 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: like this gist? https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9 On Thu, May 4, 2017 at 3:36 AM Jos? Valim wrote: > I have rebuilt Erlang from master and both the test and the code snippet > you sent by e-mail works. In order to discard any encoding issue in the > process, can you please push your code snippets to a repository? > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, May 4, 2017 at 8:04 AM, Jos? Valim < > jose.valim@REDACTED> wrote: > >> Hi derek, >> >> I have sent a PR that improves the coverage around this feature: >> https://github.com/erlang/otp/pull/1439 >> >> The test currently passes on an old master reference. I will rebuild my >> development VM from master and follow up. >> >> >> >> *Jos? Valim* >> www.plataformatec.com.br >> Skype: jv.ptec >> Founder and Director of R&D >> >> On Thu, May 4, 2017 at 1:11 AM, derek wrote: >> >>> >>> I found this feature from some of the merged PRs of Erlang/OTP 20 >>> >>> >>> https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>> https://github.com/erlang/otp/pulls?q=unicode >>> >>> > Erlang/OTP 20.0, atoms and function can contain Unicode characters >>> >>> so I built the binary from git checked out source code (from revision >>> efcb91bce) and play with it: it seems in escript interpreting mode it >>> works, but compiling mode still has errors: >>> >>> ? cat ./hello.erl >>> #!/usr/bin/env escript >>> %% -*- coding: utf-8 -*- >>> %%! +pc unicode >>> >>> -module(hello). >>> %-mode(compile). >>> -export([main/1, 'hello_??????_??'/0]). >>> >>> main(_) -> >>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>> % 'hello_'(), >>> io:setopts([{encoding,unicode}]), >>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>> 'hello_??????_??'(), >>> io:format("~tp~n", [{"Hello, ??, ??????"}]). >>> >>> 'hello_??????_??'() -> >>> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, >>> "Hello, ??; ??????"}]). >>> >>> ? erlang20 ./hello.erl >>> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} >>> {"Hello, ??, ??????"} >>> >>> If I uncomment the "-mode(compile)." line, it just runs into compilation >>> error (same as below shell compilation errors) >>> >>> Or in the Erlang shell, trying to compile it just failed: (I have to >>> remove (or comment out) the first "#!/usr/bin/env escript" line) >>> >>> ? erlang20 >>> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] >>> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V9.0 (abort with ^G) >>> 1> c(hello). >>> hello.erl: internal error in beam_asm; >>> crash reason: badarg >>> >>> in function list_to_binary/1 >>> called as list_to_binary([[5,104,101,108,108,111], >>> [4,109,97,105,110], >>> [2,105,111], >>> [7,115,101,116,111,112,116,115], >>> [6,102,111,114,109,97,116], >>> >>> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028], >>> "\vmodule_info", >>> [6,101,114,108,97,110,103], >>> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) >>> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) >>> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) >>> in call from beam_asm:module/4 (beam_asm.erl, line 31) >>> in call from compile:beam_asm/1 (compile.erl, line 1370) >>> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, >>> line 329) >>> in call from compile:fold_comp/3 (compile.erl, line 355) >>> in call from compile:internal_comp/4 (compile.erl, line 339) >>> error >>> 2> >>> >>> I have looked up in many of the commit messages, still not seeing a good >>> example of how to use unicode in function names? Could some developer >>> behind this feature give more examples? >>> >>> https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri May 5 13:27:09 2017 From: rvirding@REDACTED (Robert Virding) Date: Fri, 5 May 2017 13:27:09 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: Sigh, that means someone has been "thinking". Robert On 3 May 2017 at 18:05, Ben Murphy wrote: > Well its a very deliberate decision by someone. > > erts/emulator/beam/bif.c: > > erts_send_exit_signal(BIF_P, > BIF_P->common.id, > rp, > &rp_locks, > BIF_ARG_2, > NIL, > NULL, > BIF_P == rp ? ERTS_XSIG_FLG_NO_IGN_NORMAL : > 0); > > It sends ERTS_XSIG_FLG_NO_IGN_NORMAL if you are sending a signal to > yourself. > > On Wed, May 3, 2017 at 2:03 PM, Robert Virding wrote: > > So: > > > > 1> Pid = spawn_link(fun() -> timer:sleep(infinity) end). > > <0.59.0> > > 2> exit(Pid, normal). > > true > > 3> flush(). > > ok > > 4> exit(Pid, die). > > ** exception exit: die > > > > I spawn_link a process which is not trapping and send it the signal > 'normal' > > which it ignores. As it should. I then send it the signal 'die' and it > > crashes. As it should. > > > > Now: > > > > 5> exit(self(), normal). > > ** exception exit: normal > > > > Now I send myself the signal 'normal' and I die! So there is 'normal' and > > there is 'normal' depending on to whom I send it. > > > > Where's the logic in that? > > > > Robert > > > > P.S. More to come > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri May 5 14:05:38 2017 From: rvirding@REDACTED (Robert Virding) Date: Fri, 5 May 2017 14:05:38 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: There is more. So: 1> process_flag(trap_exit, true). false 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), timer:sleep(infinity) end). <0.60.0> We trap exits and spawn_link which also traps exits and just hangs there waiting. 3> spawn(fun() -> link(Pid), exit(kill) end). <0.62.0> 4> process_info(Pid, messages). {messages,[{'EXIT',<0.62.0>,kill}]} Now we spawn a new process which links to our hanger and exits with the reason 'kill'. We can then check our hanger and see that it received a 'kill' signal which it converted to a message because it was trapping. Finally: 5> spawn(fun() -> exit(Pid, kill) end). <0.65.0> 6> flush(). Shell got {'EXIT',<0.60.0>,killed} ok we spawn another process which uses exit/2 to send a 'kill' signal to our hanger and in this case it cannot trap the signal and dies with the reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. Where's the logic in that? Robert P.S. Yes, I know that getting a 'killed' from a process which has been killed with a 'kill' signal is the correct. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex0player@REDACTED Fri May 5 14:08:15 2017 From: alex0player@REDACTED (Alex S.) Date: Fri, 5 May 2017 15:08:15 +0300 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: Message-ID: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> There is exit/1 and exit/2 which are very, very different things. exit/1 is NOT an exit signal. There is no ?kill and kill?, there is exit signal kill, which is special, and exit reason kill, which is not special. > 5 ??? 2017 ?., ? 15:05, Robert Virding ???????(?): > > There is more. So: > > 1> process_flag(trap_exit, true). > false > 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), timer:sleep(infinity) end). > <0.60.0> > > We trap exits and spawn_link which also traps exits and just hangs there waiting. > > 3> spawn(fun() -> link(Pid), exit(kill) end). > <0.62.0> > 4> process_info(Pid, messages). > {messages,[{'EXIT',<0.62.0>,kill}]} > > Now we spawn a new process which links to our hanger and exits with the reason 'kill'. We can then check our hanger and see that it received a 'kill' signal which it converted to a message because it was trapping. Finally: > > 5> spawn(fun() -> exit(Pid, kill) end). > <0.65.0> > 6> flush(). > Shell got {'EXIT',<0.60.0>,killed} > ok > > we spawn another process which uses exit/2 to send a 'kill' signal to our hanger and in this case it cannot trap the signal and dies with the reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. > > Where's the logic in that? > > Robert > > P.S. Yes, I know that getting a 'killed' from a process which has been killed with a 'kill' signal is the correct. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From rvirding@REDACTED Fri May 5 14:32:38 2017 From: rvirding@REDACTED (Robert Virding) Date: Fri, 5 May 2017 14:32:38 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> References: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> Message-ID: Yes, and no. When a process dies with a reason then that reason is sent in a signal to all the processes in the link set. So if the process dies with the reason 'foo' then a 'foo' exit signal will be sent, and if I do exit/2 to send a 'foo' exit signal then a 'foo' exit signal will be sent. In both cases, if the receiving process is not trapping it will die with the reason 'foo' [*] and if the receiving process is trapping then the exit signal will be converted to a message with reason 'foo'. In both cases it IS a 'foo' exit signal. However, if the exit reason is 'kill' then the 'kill' exit signal sent from the process will be trapped while if it is sent with exit/2 it is not trappable. THIS IS THE ONLY EXIT SIGNAL WHICH BEHAVES DIFFERENTLY! [**] Again where's the logic in that? Why the inconsistency? We tried hard back in the old days to be consistent. Robert * As 'foo' is not the value 'normal' it will kill the process. **Sorry of raising my voice. On 5 May 2017 at 14:08, Alex S. wrote: > There is exit/1 and exit/2 which are very, very different things. exit/1 > is NOT an exit signal. > There is no ?kill and kill?, there is exit signal kill, which is special, > and exit reason kill, which is not special. > > 5 ??? 2017 ?., ? 15:05, Robert Virding ???????(?): > > > > There is more. So: > > > > 1> process_flag(trap_exit, true). > > false > > 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), > timer:sleep(infinity) end). > > <0.60.0> > > > > We trap exits and spawn_link which also traps exits and just hangs there > waiting. > > > > 3> spawn(fun() -> link(Pid), exit(kill) end). > > <0.62.0> > > 4> process_info(Pid, messages). > > {messages,[{'EXIT',<0.62.0>,kill}]} > > > > Now we spawn a new process which links to our hanger and exits with the > reason 'kill'. We can then check our hanger and see that it received a > 'kill' signal which it converted to a message because it was trapping. > Finally: > > > > 5> spawn(fun() -> exit(Pid, kill) end). > > <0.65.0> > > 6> flush(). > > Shell got {'EXIT',<0.60.0>,killed} > > ok > > > > we spawn another process which uses exit/2 to send a 'kill' signal to > our hanger and in this case it cannot trap the signal and dies with the > reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. > > > > Where's the logic in that? > > > > Robert > > > > P.S. Yes, I know that getting a 'killed' from a process which has been > killed with a 'kill' signal is the correct. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Fri May 5 14:35:22 2017 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Fri, 5 May 2017 14:35:22 +0200 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: I have ran the following on Erlang master, commit ffa80a4137: $ curl https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl | tail -n +2 > hello.erl $ erlc hello.erl And everything compiles just fine. Hopefully someone else can give it a try and let us know if they can reproduce the issue or not. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Thu, May 4, 2017 at 11:23 PM, derek wrote: > like this gist? https://gist.github.com/anonymous/ > 2e8babd349167a49eb6f6d55ec0505c9 > > On Thu, May 4, 2017 at 3:36 AM Jos? Valim > wrote: > >> I have rebuilt Erlang from master and both the test and the code snippet >> you sent by e-mail works. In order to discard any encoding issue in the >> process, can you please push your code snippets to a repository? >> >> >> >> *Jos? Valim* >> www.plataformatec.com.br >> Skype: jv.ptec >> Founder and Director of R&D >> >> On Thu, May 4, 2017 at 8:04 AM, Jos? Valim > br> wrote: >> >>> Hi derek, >>> >>> I have sent a PR that improves the coverage around this feature: >>> https://github.com/erlang/otp/pull/1439 >>> >>> The test currently passes on an old master reference. I will rebuild my >>> development VM from master and follow up. >>> >>> >>> >>> *Jos? Valim* >>> www.plataformatec.com.br >>> Skype: jv.ptec >>> Founder and Director of R&D >>> >>> On Thu, May 4, 2017 at 1:11 AM, derek wrote: >>> >>>> >>>> I found this feature from some of the merged PRs of Erlang/OTP 20 >>>> >>>> https://github.com/erlang/otp/blob/master/lib/stdlib/doc/ >>>> src/unicode_usage.xml#L66-L71 >>>> https://github.com/erlang/otp/pulls?q=unicode >>>> >>>> > Erlang/OTP 20.0, atoms and function can contain Unicode characters >>>> >>>> so I built the binary from git checked out source code (from revision >>>> efcb91bce) and play with it: it seems in escript interpreting mode it >>>> works, but compiling mode still has errors: >>>> >>>> ? cat ./hello.erl >>>> #!/usr/bin/env escript >>>> %% -*- coding: utf-8 -*- >>>> %%! +pc unicode >>>> >>>> -module(hello). >>>> %-mode(compile). >>>> -export([main/1, 'hello_??????_??'/0]). >>>> >>>> main(_) -> >>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>> % 'hello_'(), >>>> io:setopts([{encoding,unicode}]), >>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>> 'hello_??????_??'(), >>>> io:format("~tp~n", [{"Hello, ??, ??????"}]). >>>> >>>> 'hello_??????_??'() -> >>>> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, >>>> "Hello, ??; ??????"}]). >>>> >>>> ? erlang20 ./hello.erl >>>> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} >>>> {"Hello, ??, ??????"} >>>> >>>> If I uncomment the "-mode(compile)." line, it just runs into >>>> compilation error (same as below shell compilation errors) >>>> >>>> Or in the Erlang shell, trying to compile it just failed: (I have to >>>> remove (or comment out) the first "#!/usr/bin/env escript" line) >>>> >>>> ? erlang20 >>>> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] >>>> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] >>>> >>>> Eshell V9.0 (abort with ^G) >>>> 1> c(hello). >>>> hello.erl: internal error in beam_asm; >>>> crash reason: badarg >>>> >>>> in function list_to_binary/1 >>>> called as list_to_binary([[5,104,101,108,108,111], >>>> [4,109,97,105,110], >>>> [2,105,111], >>>> [7,115,101,116,111,112,116,115], >>>> [6,102,111,114,109,97,116], >>>> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076, >>>> 95,19990,30028], >>>> "\vmodule_info", >>>> [6,101,114,108,97,110,103], >>>> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) >>>> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) >>>> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) >>>> in call from beam_asm:module/4 (beam_asm.erl, line 31) >>>> in call from compile:beam_asm/1 (compile.erl, line 1370) >>>> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, >>>> line 329) >>>> in call from compile:fold_comp/3 (compile.erl, line 355) >>>> in call from compile:internal_comp/4 (compile.erl, line 339) >>>> error >>>> 2> >>>> >>>> I have looked up in many of the commit messages, still not seeing a >>>> good example of how to use unicode in function names? Could some developer >>>> behind this feature give more examples? >>>> https://github.com/erlang/otp/blame/master/lib/stdlib/doc/ >>>> src/unicode_usage.xml#L66-L71 >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri May 5 16:21:58 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 5 May 2017 16:21:58 +0200 Subject: [erlang-questions] Common Test last test report In-Reply-To: References: <73d81ce9-ecbc-e823-36aa-e70d8a7366b3@ninenines.eu> Message-ID: On 04/20/2017 01:03 PM, Peter Andersson E wrote: > On 02/25/2017 12:20 AM, Lo?c Hoguin wrote: >> Hello, >> >> It's still difficult to get to the last test report in Common Test. >> Currently the URI looks like this: >> >> file:///home/essen/ninenines/cowboy/logs/ct_run.ct_cowboy@REDACTED/ninenines.cowboy.rfc7540_SUITE.logs/run.2017-02-25_00.02.29/suite.log.html >> >> >> Which is great, I can always go back and compare, and sometimes that's >> what I want (when I test across Erlang releases, for example). But >> when I'm fixing a bug, I tend to run a small set of tests, maybe a >> single suite, or sometimes even just a single group or a single test >> case. When I do that, things becomes more difficult than they should >> be because I can't simply refresh the page to get the new report, I >> have to go back, refresh on the all_runs.html page, and follow the >> links from there. >> >> Would it be possible for Common Test to maintain a separate directory >> always containing the latest report? For example: >> >> file:///home/essen/ninenines/cowboy/logs/ct_run.ct_cowboy@REDACTED/ninenines.cowboy.rfc7540_SUITE.logs/run.latest/suite.log.html >> >> >> With a URI like this I can repeat the test run, refresh in my browser >> and get the new report instantly. (And keep the history separate >> should I need to compare.) >> >> Alternatively, have an option to disable the timestamps so I can just >> refresh when I need it, although the history wouldn't be preserved in >> this case. >> >> Cheers, >> > > Hi Lo?c + anyone else interested, > > I've made a solution to this problem as follows: > > In the top level log directory (i.e. where the top level index files, > all_runs.html and index.html, are stored) an html file, > suite.log.latest.html, is written at the start of each test run, which > contains an redirection (immediate, without a click) to the latest saved > suite.log.html (test case overview). There is a link to this redirection > page in the footer of suite.log.html. This makes it possible to jump > immediately to the latest test results from any test case overview page > without having to navigate to the top level index first. So this is > useful when you're running the same tests repeatedly and want to update > and/or compare results. > > The shortcoming of this design, however, is that it ignores the test > name. It's the latest report in 'logdir' that is jumped to, not the > latest report for the current set of tests (like e.g. what you get in > the top level index.html page). Example: If you run a set of tests, A, > then repeat this set, A', then run a new set of tests, B, then if you're > analyzing the results of A and click the latest results link, you're > redirected to the report for B, not A'. > > The workaround in the above example is either to use different top level > log directories for A and B test runs, or to navigate from > suite.log.html for A to the top level index.html (via the link in the > footer) and go to A' from there. > > My question is, what do you guys prefer? Is the current implementation > as I descibe it sufficient and useful, or would a more complex solution > with "name scoped redirections" make more sense? I'd appreciate the input! Hello! Sorry I didn't reply earlier. The solution you describe would work well enough for me I think. It helps with "run tests, check the results, fix things, run tests again, compare the results and see what broke/got fixed". I do not have much value for keeping the logs around personally, so would not need the workaround you mention and/or a better fix. Maybe someone else would. Thanks for your great work! -- Lo?c Hoguin https://ninenines.eu From alex0player@REDACTED Fri May 5 16:26:46 2017 From: alex0player@REDACTED (Alex S.) Date: Fri, 5 May 2017 17:26:46 +0300 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> Message-ID: <3628570B-01A9-47B6-981A-51D74A63153B@gmail.com> I think the logic is in the different explicit intent, which is present when exit/2ing someothing with ?kill?, but absent when crashing with ?kill?. Besides, crashing with ?kill? behaving ?consistently? would mean broadcasting a brutal kill, which is rarely, if ever, desirable. > 5 ??? 2017 ?., ? 15:32, Robert Virding ???????(?): > > Yes, and no. When a process dies with a reason then that reason is sent in a signal to all the processes in the link set. So if the process dies with the reason 'foo' then a 'foo' exit signal will be sent, and if I do exit/2 to send a 'foo' exit signal then a 'foo' exit signal will be sent. In both cases, if the receiving process is not trapping it will die with the reason 'foo' [*] and if the receiving process is trapping then the exit signal will be converted to a message with reason 'foo'. In both cases it IS a 'foo' exit signal. > > However, if the exit reason is 'kill' then the 'kill' exit signal sent from the process will be trapped while if it is sent with exit/2 it is not trappable. THIS IS THE ONLY EXIT SIGNAL WHICH BEHAVES DIFFERENTLY! [**] > > Again where's the logic in that? Why the inconsistency? We tried hard back in the old days to be consistent. > > Robert > > * As 'foo' is not the value 'normal' it will kill the process. > **Sorry of raising my voice. > > > On 5 May 2017 at 14:08, Alex S. > wrote: > There is exit/1 and exit/2 which are very, very different things. exit/1 is NOT an exit signal. > There is no ?kill and kill?, there is exit signal kill, which is special, and exit reason kill, which is not special. > > 5 ??? 2017 ?., ? 15:05, Robert Virding > ???????(?): > > > > There is more. So: > > > > 1> process_flag(trap_exit, true). > > false > > 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), timer:sleep(infinity) end). > > <0.60.0> > > > > We trap exits and spawn_link which also traps exits and just hangs there waiting. > > > > 3> spawn(fun() -> link(Pid), exit(kill) end). > > <0.62.0> > > 4> process_info(Pid, messages). > > {messages,[{'EXIT',<0.62.0>,kill}]} > > > > Now we spawn a new process which links to our hanger and exits with the reason 'kill'. We can then check our hanger and see that it received a 'kill' signal which it converted to a message because it was trapping. Finally: > > > > 5> spawn(fun() -> exit(Pid, kill) end). > > <0.65.0> > > 6> flush(). > > Shell got {'EXIT',<0.60.0>,killed} > > ok > > > > we spawn another process which uses exit/2 to send a 'kill' signal to our hanger and in this case it cannot trap the signal and dies with the reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. > > > > Where's the logic in that? > > > > Robert > > > > P.S. Yes, I know that getting a 'killed' from a process which has been killed with a 'kill' signal is the correct. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Fri May 5 17:09:57 2017 From: kenneth@REDACTED (Kenneth Lundin) Date: Fri, 5 May 2017 17:09:57 +0200 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing Message-ID: OTP 20 Release Candidate 1 This is the first of two release candidates before the OTP 20 release in June 2017. The intention with this release is that you as users try it and give us feedback if something does not work as expected. Could be a bug, an unexpected incompatibility, a significant change of characteristics in negative direction, etc. Erlang/OTP 20.0 is a new major release with new features, quite a few (characteristics) improvements, as well as a few incompatibilities. Here are some of the most important news: Potential Incompatibilities - ERTS: - The non SMP Erlang VM is deprecated and not built by default - Remove deprecated erlang:hash/2 - erlang:statistics/1 with scheduler_wall_time now also includes info about dirty CPU schedulers. - The new purge strategy introduced in OTP 19.1 is mandatory and slightly incompatible for processes holding funs see erlang:check_process_code/3. - The NIF library reload is not supported anymore. - Asn1: Deprecated module and functions removed (asn1rt, asn1ct:encode/3 and decode/3) - Ssh: client only option in a call to start a daemon will now fail Highlights Erts: - Dirty schedulers enabled and supported on VM with SMP support. - support for ?dirty? BIFs and ?dirty? GC. - erlang:garbage_collect/2 for control of minor or major GC - Erlang literals are no longer copied when sending messages. - Improved performance for large ETS tables, >256 entries (except ordered_set) - erlang:system_info/1 atom_count and atom_limit - Reduced memory pressure by converting sub-binaries to heap-binaries during GC - enif_select, map an external event to message Compiler: - Code generation for complicated guards is improved. - Warnings for repeated identical map keys. #{'a'=>1, 'b'=>2, 'a'=>3} will warn for the repeated key a. - By default there is now a warning when export_all is used. Can be disabled - Pattern matching for maps is optimized - New option deterministic to omit path to source + options info the BEAM file. - Atoms may now contain arbitrary unicode characters. - compile:file/2 has an option to include extra chunks in the BEAM file. Misc other applications - Unnamed ets tables optimized - A new event manager to handle a subset of OS signals in Erlang - Optimized sets add_element, del_element and union - Added rand:jump/0-1 - When a gen_server crashes, the stacktrace for the client will be printed to facilitate debugging. - take/2 has been added to dict, orddict, and gb_trees. - take_any/2 has been added to gb_trees - Significantly updated string module with unicode support - erl_tar support for long path names and new file formats - Dtls: Documented API, experimental - SSH: improving security, removing and adding algorithms - New math:fmod/2 For more details see http://erlang.org/download/otp_src_20.0-rc1.readme Pre built versions for Windows can be fetched here: http://erlang.org/download/otp_win32_20.0-rc1.exe http://erlang.org/download/otp_win64_20.0-rc1.exe On line documentation can be browsed here: www.erlang.org/documentation/doc-9.0-rc1/doc/ Thanks to all contributors. /The Erlang/OTP team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri May 5 18:51:05 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 May 2017 19:51:05 +0300 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: Is there any documentation for dtls? -------------- next part -------------- An HTML attachment was scrubbed... URL: From askjuise@REDACTED Fri May 5 19:55:57 2017 From: askjuise@REDACTED (Alexander Petrovsky) Date: Fri, 05 May 2017 17:55:57 +0000 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: ??, 5 ??? 2017 ?. ? 18:10, Kenneth Lundin : > OTP 20 Release Candidate 1 > > This is the first of two release candidates before the OTP 20 release in > June 2017. > > The intention with this release is that you as users try it and give us > feedback if something does not work as expected. Could be a bug, an > unexpected incompatibility, a significant change of characteristics in > negative direction, etc. > > Erlang/OTP 20.0 is a new major release with new features, quite a few > (characteristics) improvements, as well as a few incompatibilities. > > Here are some of the most important news: > Potential Incompatibilities > > - > > ERTS: > - The non SMP Erlang VM is deprecated and not built by default > - Remove deprecated erlang:hash/2 > - erlang:statistics/1 with scheduler_wall_time now also includes > info about dirty CPU schedulers. > - The new purge strategy introduced in OTP 19.1 is mandatory and > slightly incompatible for processes holding funs > see erlang:check_process_code/3. > - The NIF library reload is not supported anymore. > - > > Asn1: Deprecated module and functions removed (asn1rt, asn1ct:encode/3 > and decode/3) > - > > Ssh: client only option in a call to start a daemon will now fail > > Highlights Erts: > > - Dirty schedulers enabled and supported on VM with SMP support. > - support for ?dirty? BIFs and ?dirty? GC. > - erlang:garbage_collect/2 for control of minor or major GC > - Erlang literals are no longer copied when sending messages. > > Could you explain please, what does mean "Erlang literals"? > - > - Improved performance for large ETS tables, >256 entries (except > ordered_set) > - erlang:system_info/1 atom_count and atom_limit > - Reduced memory pressure by converting sub-binaries to heap-binaries > during GC > - enif_select, map an external event to message > > Compiler: > > - Code generation for complicated guards is improved. > - Warnings for repeated identical map keys. #{'a'=>1, 'b'=>2, 'a'=>3} > will warn for the repeated key a. > - By default there is now a warning when export_all is used. Can be > disabled > - Pattern matching for maps is optimized > - New option deterministic to omit path to source + options info the > BEAM file. > - Atoms may now contain arbitrary unicode characters. > - compile:file/2 has an option to include extra chunks in the BEAM > file. > > Misc other applications > > - Unnamed ets tables optimized > - A new event manager to handle a subset of OS signals in Erlang > - Optimized sets add_element, del_element and union > - Added rand:jump/0-1 > - When a gen_server crashes, the stacktrace for the client will be > printed to facilitate debugging. > - take/2 has been added to dict, orddict, and gb_trees. > - take_any/2 has been added to gb_trees > - Significantly updated string module with unicode support > - erl_tar support for long path names and new file formats > - Dtls: Documented API, experimental > - SSH: improving security, removing and adding algorithms > - New math:fmod/2 > > For more details see > http://erlang.org/download/otp_src_20.0-rc1.readme > > Pre built versions for Windows can be fetched here: > http://erlang.org/download/otp_win32_20.0-rc1.exe > http://erlang.org/download/otp_win64_20.0-rc1.exe > > On line documentation can be browsed here: > www.erlang.org/documentation/doc-9.0-rc1/doc/ > > Thanks to all contributors. > > /The Erlang/OTP team at Ericsson > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 914 8 820 815 -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Fri May 5 21:00:32 2017 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Fri, 05 May 2017 19:00:32 +0000 Subject: [erlang-questions] enif_select() questions Message-ID: - When the resource stop() callback is invoked with is_direct_call==false, is the provided environment considered a "process" environment? (ie, should I pass it as the first parameter to enif_send() or leave null?) Same question for resource down() callback. - enif_select() appears to not add a reference to the associated resource. What should happen if the resource gets garbage collected (dtor invoked) while it has outstanding an enif_select()? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri May 5 21:03:35 2017 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 5 May 2017 21:03:35 +0200 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: Hi! 2017-05-05 18:51 GMT+02:00 Max Lapshin : > Is there any documentation for dtls? > > Not in the sens that it is documented in the manual page. But it is documented in the current release notes of the ssl application what you need to do to test it. The API is the same as f?r TLS except that you need to provide the option {protocol, dtls}. Regards Ingela Erlang/OTP team - Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri May 5 21:20:04 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 May 2017 22:20:04 +0300 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: Great! We are still locked with erlang 19.0 because we have used internal ssl headers to implement our dtls. I will reschedule our dev plan to try to move to 20.0 api -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Fri May 5 21:35:22 2017 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Fri, 5 May 2017 21:35:22 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> Message-ID: This stuff has been up several times before. Here's one from 2009 where I looked into it: http://erlang.org/pipermail/erlang-questions/2009-October/047190.html Then there's this one from 2010 where Robert answered: http://erlang.org/pipermail/erlang-questions/2010-December/055003.html And here's one from 2015 started by Robert: http://erlang.org/pipermail/erlang-questions/2015-October/086289.html /Richard /Richard 2017-05-05 14:32 GMT+02:00 Robert Virding : > Yes, and no. When a process dies with a reason then that reason is sent in > a signal to all the processes in the link set. So if the process dies with > the reason 'foo' then a 'foo' exit signal will be sent, and if I do exit/2 > to send a 'foo' exit signal then a 'foo' exit signal will be sent. In both > cases, if the receiving process is not trapping it will die with the reason > 'foo' [*] and if the receiving process is trapping then the exit signal > will be converted to a message with reason 'foo'. In both cases it IS a > 'foo' exit signal. > > However, if the exit reason is 'kill' then the 'kill' exit signal sent > from the process will be trapped while if it is sent with exit/2 it is not > trappable. THIS IS THE ONLY EXIT SIGNAL WHICH BEHAVES DIFFERENTLY! [**] > > Again where's the logic in that? Why the inconsistency? We tried hard back > in the old days to be consistent. > > Robert > > * As 'foo' is not the value 'normal' it will kill the process. > **Sorry of raising my voice. > > > On 5 May 2017 at 14:08, Alex S. wrote: > >> There is exit/1 and exit/2 which are very, very different things. exit/1 >> is NOT an exit signal. >> There is no ?kill and kill?, there is exit signal kill, which is special, >> and exit reason kill, which is not special. >> > 5 ??? 2017 ?., ? 15:05, Robert Virding ???????(?): >> > >> > There is more. So: >> > >> > 1> process_flag(trap_exit, true). >> > false >> > 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), >> timer:sleep(infinity) end). >> > <0.60.0> >> > >> > We trap exits and spawn_link which also traps exits and just hangs >> there waiting. >> > >> > 3> spawn(fun() -> link(Pid), exit(kill) end). >> > <0.62.0> >> > 4> process_info(Pid, messages). >> > {messages,[{'EXIT',<0.62.0>,kill}]} >> > >> > Now we spawn a new process which links to our hanger and exits with the >> reason 'kill'. We can then check our hanger and see that it received a >> 'kill' signal which it converted to a message because it was trapping. >> Finally: >> > >> > 5> spawn(fun() -> exit(Pid, kill) end). >> > <0.65.0> >> > 6> flush(). >> > Shell got {'EXIT',<0.60.0>,killed} >> > ok >> > >> > we spawn another process which uses exit/2 to send a 'kill' signal to >> our hanger and in this case it cannot trap the signal and dies with the >> reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. >> > >> > Where's the logic in that? >> > >> > Robert >> > >> > P.S. Yes, I know that getting a 'killed' from a process which has been >> killed with a 'kill' signal is the correct. >> > >> > _______________________________________________ >> > 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 carlsson.richard@REDACTED Fri May 5 21:56:09 2017 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Fri, 5 May 2017 21:56:09 +0200 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: I'd like to point out the following changes in the Erlang shell, for your everyday use: OTP-14190 Application(s): stdlib The shell functions c/1 and c/2 have been extended so that if the argument is a module name instead of a file name, it automatically locates the .beam file and the corresponding source file, and then recompiles the module using the same compiler options (plus any options passed to c/2). If compilation fails, the old beam file is preserved. Also adds c(Mod, Opts, Filter), where the Filter argument allows you to remove old compiler options before the new options are added. New utility functions file_find/2/3 and find_source/1/2/3 have been added to filelib. OTP-14059 Application(s): kernel, stdlib Functions for detecting changed code has been added. code:modified_modules/0 returns all currently loaded modules that have changed on disk. code:module_status/1 returns the status for a module. In the shell and in c module, mm/0 is short for code:modified_modules/0, and lm/0 reloads all currently loaded modules that have changed on disk. /Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Fri May 5 22:05:30 2017 From: pablo.platt@REDACTED (pablo platt) Date: Fri, 5 May 2017 23:05:30 +0300 Subject: [erlang-questions] Plans for multi-pollset? Message-ID: Hi, I don't see multi-pollset in OTP 20.0-rc1 release notes. What are the plans for it? Is there still a chance for it to be included in the final OTP 20.0 a future point release or will it have to wait for OTP 21.0? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Fri May 5 22:11:58 2017 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 5 May 2017 22:11:58 +0200 Subject: [erlang-questions] Plans for multi-pollset? In-Reply-To: References: Message-ID: The plan is still to have multi-pollset in OTP 20. (and in RC2). /Kenneth, Erlang/OTP, Ericsson On Fri, May 5, 2017 at 10:05 PM, pablo platt wrote: > Hi, > > I don't see multi-pollset in OTP 20.0-rc1 release notes. > What are the plans for it? > Is there still a chance for it to be included in the final OTP 20.0 a > future point release or will it have to wait for OTP 21.0? > > Thanks > > _______________________________________________ > 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 Fri May 5 22:18:47 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 May 2017 23:18:47 +0300 Subject: [erlang-questions] Plans for multi-pollset? In-Reply-To: References: Message-ID: sorry for asking late question, but I thought that erlang has several epoll queues: one per thread. It is not so in 19? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri May 5 22:44:55 2017 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 5 May 2017 13:44:55 -0700 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: References: Message-ID: <590CE447.4030603@gmail.com> It seems good to point out a change that may surprise people that have scripts that depend on the old process name "beam.smp" which now changes to the script name, or is set by an environment variable: OTP-14381 Application(s): erts Changed erts startup program name, argv 0, to use the environment variable ESCRIPT_NAME so that erlc, dialyzer, typer, ct_run, or the escript name can be seen with external programs, such as ps and htop (depending on options), on unix. If environment variable ESCRIPT_NAME is not set, argv 0 of the invoking program will be used, e.g. the name will be erl, cerl, or the soft link name. This is a great change, but one to be aware of. Best Regards, Michael From kelvin.poon@REDACTED Fri May 5 22:00:56 2017 From: kelvin.poon@REDACTED (Kelvin Poon (Scotiabank GBM)) Date: Fri, 5 May 2017 20:00:56 +0000 Subject: [erlang-questions] Erlang Install on i368-pc-sollaris2.10 issues Message-ID: <0C408DB7181F8F4DAD08D9C309E0BE717A5D67B7@SCTORMAIL102.scglobal.ad.scotiacapital.com> Hi, I am running into an issue with an Erlang install on our Unix machine (Solaris 10). Erlang version: R16B03 OS: Solaris 10 I am following the steps listed on the official install page: https://github.com/erlang/otp/blob/maint/HOWTO/INSTALL.md I have unpacked the tar file from erlang.org, these are the steps I have followed: export ERL_TOP=/otp_src_R16B03 export DED_LD=gcc #using gcc located at /usr/sfw/bin/gcc export PATH=/usr/sfw/bin:/usr/xpg4/bin/:/bin ./configure -prefix= Configuration finished with: (I can post the entire output if necessary) --- ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* odbc : ODBC library - link check failed ********************************************************************* ********************************************************************* ********************** APPLICATIONS INFORMATION ******************* ********************************************************************* wx : wxWidgets not found, wx will NOT be usable ********************************************************************* ********************************************************************* ********************** DOCUMENTATION INFORMATION ****************** ********************************************************************* documentation : fop is missing. Using fakefop to generate placeholder PDF files. --- gmake #located at /usr/sfw/bin/gmake The error I receive is: --- gcc -o ../priv/lib/i386-pc-solaris2.10/trace_ip_drv.so ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o -lc -lsendfile -ldlpi -ldl -lm -lsocket -lnsl Undefined first referenced symbol in file main /usr/lib/crt1.o set_port_control_flags ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o driver_alloc ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o driver_alloc_binary ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o driver_free ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o driver_select ../priv/obj/i386-pc-solaris2.10/trace_ip_drv.o ld: fatal: symbol referencing errors. No output written to ../priv/lib/i386-pc-solaris2.10/trace_ip_drv.so collect2: ld returned 1 exit status --- I looked around..it looks like it has to do with the gcc library on solaris. Is this an issue with my gcc install where it has unresolved symbols? I realize I can get pass this by using LDFLAGS=-W1,-x,nodefs where it ignores unresolved symbols. However I need this for the purpose of running RabbitMQ, and I run into other issues when running RabbitMQ when install Erlang this way, so I would like to see what your opinions are. Thanks, Kelvin Poon | Associate Director, Algorithmic Trading and Routing | Quantitative Trading Solutions | Scotia Capital Inc. ________________________________________________________ Scotiabank | Global Banking and Markets 40 King Street West, 65th Floor, Toronto, ON, Canada, M5H 1H1 Direct: (416) 863-7455 | EES Trading: (416) 862-3208 | Mobile: (647) 966-9631 | Fax: (416) 862-3208 kelvin.poon@REDACTED Scotiabank.com Scotiabank is a business name used by Scotia Capital Inc. Please click this link kelvin.poon@REDACTED to email the sender for removal from this specific note/publication. TM Trademark of The Bank of Nova Scotia. Used under license, where applicable. Scotiabank, together with "Global Banking and Markets", is a marketing name for the global corporate and investment banking and capital markets businesses of The Bank of Nova Scotia and certain of its affiliates in the countries where they operate, including Scotia Capital Inc. (Member-Canadian Investor Protection Fund). This publication is not a research report. Consequently this commentary is not governed by rules applicable to the publication and distribution of research reports, including relevant restrictions or disclosures required to be included in research reports. This publication is not meant to provide information sufficient upon to base an investment decision, or to replace any due diligence or analytical work required by you in making investment decisions. This communication has been prepared and distributed by staff of Scotia Capital Inc.'s Institutional Equity Sales and Trading Desk (a Canadian Investment Dealer, member of IIROC) solely for the use of sophisticated institutional investors. The opinions and statements contained herein are intended for information purposes only and are subject to change without notice. In addition, the opinions and statements contained herein are based on information taken from sources believed to be reliable, but no representation or warranty, express or implied, is made as to their accuracy, completeness, or timeliness. Furthermore, the opinions expressed herein represent the personal views of the writer and may not be shared by other members of the Institutional Equity Desk or other areas, units, divisions or affiliates of Scotia Capital Inc. Additionally, either the Institutional Equity Desk or other areas or divisions could trade in accordance with the views expressed or trade against these views. Any transactions by US Institutional Investors in any security mentioned or referenced in this publication cannot be effected through Scotia Capital Inc. and must be executed with a U.S. broker-dealer, including Scotia Capital (USA) Inc., an affiliate of Scotia Capital Inc. Scotia Capital Inc., its directors, officers, employees, affiliates or clients may currently or from time to time own or hold interests in long or short positions in the securities referred to herein, and may at any time make purchases or sales of these securities as principal or agent. Scotia Capital Inc. or its affiliates may have provided or may provide investment banking, capital markets advice or other services to the companies referred to in this communication. This email should not be construed as investment advice or as an offer to sell or a solicitation of an offer to buy any securities or other financial instruments. Neither Scotia Capital Inc. nor any of its officers, directors, partners, employees or affiliates accepts any liability for any direct or consequential loss arising from this publication or its contents. Scotia Capital Inc. recommends that investors independently evaluate each issuer and security discussed in this publication, and consult with any advisors they deem necessary prior to making any investment. Scotia Capital Inc. owns or controls an equity interest in TMX Group Limited and in excess of 1% of the issued and outstanding equity securities thereof. As such, Scotia Capital Inc. may be considered to have an economic interest in TMX Group Limited including the various marketplaces operated by it such as the Toronto Stock Exchange, the TSX Venture Exchange and the Alpha Exchange. Scotia Capital Inc. has a nominee director serving on the Board of Directors of TMX Group Limited. Redistribution or onward forwarding of this email is strictly prohibited. If you believe that this email was sent to you in error, please forward a message to that effect as soon as practicable to trade.supervision@REDACTED. This e-mail and any attachments may contain confidential or privileged information. If you are not an intended recipient, do not re-send, copy or use this e-mail. Please also contact the sender immediately and delete this e-mail in its entirety. Privilege is not waived by reason of mistaken delivery to you. The Bank of Nova Scotia (Scotiabank) and its affiliates accept no liability whatsoever for loss or damage in relation to this e-mail and may monitor, retain and/or review email. Opinions expressed in this e-mail are those of the author and may not represent the opinions of The Bank of Nova Scotia (Scotiabank) and its affiliates. Trading instructions received by e-mail or voicemail will not be acted upon. To unsubscribe from receiving further Commercial Electronic Messages click here [https://www.unsubscribe.gbm.scotiabank.com/]. Pour obtenir la traduction en fran?ais: http://www.gbm.scotiabank.com/EmailDisclaimer/French.htm Traducci?n en espa?ol: http://www.gbm.scotiabank.com/EmailDisclaimer/Spanish.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri May 5 22:55:56 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 5 May 2017 23:55:56 +0300 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: <590CE447.4030603@gmail.com> References: <590CE447.4030603@gmail.com> Message-ID: Eh, is this enough? I've made changing program name in flussonic and had to make following changes: 1) prctl(PR_SET_NAME, name) 2) dirty hack to get erts argv and change argv[0]. If somebody don't know, argv[0] lives on a special page and its changing involves running kernel code 3) for MacOS it is: dirty OSX code around com.apple.LaunchServices, _LSSetApplicationInformationItem, _kLSDisplayNameKey and ls_set_application_information_item_func There are several program names in different unixes and you can see them in different tools. For example, there may be a master program name and different names of tasks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Sat May 6 01:01:45 2017 From: sdl.web@REDACTED (Leo Liu) Date: Sat, 06 May 2017 07:01:45 +0800 Subject: [erlang-questions] Exit signals are funny things References: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> Message-ID: On 2017-05-05 21:35 +0200, Richard Carlsson wrote: > This stuff has been up several times before. Here's one from 2009 where I > looked into it: > http://erlang.org/pipermail/erlang-questions/2009-October/047190.html > > Then there's this one from 2010 where Robert answered: > http://erlang.org/pipermail/erlang-questions/2010-December/055003.html > > And here's one from 2015 started by Robert: > http://erlang.org/pipermail/erlang-questions/2015-October/086289.html > > /Richard All of these seem making sense. There is this little thing that is confusing. 1> spawn_link(fun () -> exit(kill) end). ** exception exit: killed exit(kill) is unlike other exit(Reason) i.e. it's rewritten as `killed'. Leo From denc716@REDACTED Sat May 6 03:47:55 2017 From: denc716@REDACTED (derek) Date: Sat, 06 May 2017 01:47:55 +0000 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: No; I built this from current `master@REDACTED`, it seems nothing changed, either erlc or c() from erlang shell still doesn't compile it prompts error in line 213 of beam_asm.erl, but line 213 of this file doesn't have call to list_to_binary; as I read, it seems on #L245, the list_to_binary doesn't work with this list string `[16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44],` because this string has chars (>255), it needs unicode:characters_to_binary can work https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L245 Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.0 (abort with ^G) 1> c(hello). hello.erl: internal error in beam_asm; crash reason: badarg in function list_to_binary/1 called as list_to_binary([[5,104,101,108,108,111], [4,109,97,105,110], [2,105,111], [7,115,101,116,111,112,116,115], [6,102,111,114,109,97,116], [16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44], "\vmodule_info", [6,101,114,108,97,110,103], [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) in call from beam_asm:chunk/3 (beam_asm.erl, line 213) in call from beam_asm:build_file/8 (beam_asm.erl, line 97) in call from beam_asm:module/4 (beam_asm.erl, line 31) in call from compile:beam_asm/1 (compile.erl, line 1370) in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 329) in call from compile:fold_comp/3 (compile.erl, line 355) in call from compile:internal_comp/4 (compile.erl, line 339) error 2> list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). ** exception error: bad argument in function list_to_binary/1 called as list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076, 95,19990,30028,44]) 3> unicode:characters_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). <<16,104,101,108,108,111,95,209,142,208,189,208,184,208, 186,208,190,208,180,95,228,184,150,231,149,140,44>> On Fri, May 5, 2017 at 5:35 AM Jos? Valim wrote: > I have ran the following on Erlang master, commit ffa80a4137: > > $ curl > https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl > | tail -n +2 > hello.erl > $ erlc hello.erl > > And everything compiles just fine. Hopefully someone else can give it a > try and let us know if they can reproduce the issue or not. > > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, May 4, 2017 at 11:23 PM, derek wrote: > >> like this gist? >> https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9 >> >> On Thu, May 4, 2017 at 3:36 AM Jos? Valim < >> jose.valim@REDACTED> wrote: >> >>> I have rebuilt Erlang from master and both the test and the code snippet >>> you sent by e-mail works. In order to discard any encoding issue in the >>> process, can you please push your code snippets to a repository? >>> >>> >>> >>> *Jos? Valim* >>> www.plataformatec.com.br >>> Skype: jv.ptec >>> Founder and Director of R&D >>> >>> On Thu, May 4, 2017 at 8:04 AM, Jos? Valim < >>> jose.valim@REDACTED> wrote: >>> >>>> Hi derek, >>>> >>>> I have sent a PR that improves the coverage around this feature: >>>> https://github.com/erlang/otp/pull/1439 >>>> >>>> The test currently passes on an old master reference. I will rebuild my >>>> development VM from master and follow up. >>>> >>>> >>>> >>>> *Jos? Valim* >>>> www.plataformatec.com.br >>>> Skype: jv.ptec >>>> Founder and Director of R&D >>>> >>>> On Thu, May 4, 2017 at 1:11 AM, derek wrote: >>>> >>>>> >>>>> I found this feature from some of the merged PRs of Erlang/OTP 20 >>>>> >>>>> >>>>> https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>>>> https://github.com/erlang/otp/pulls?q=unicode >>>>> >>>>> > Erlang/OTP 20.0, atoms and function can contain Unicode characters >>>>> >>>>> so I built the binary from git checked out source code (from revision >>>>> efcb91bce) and play with it: it seems in escript interpreting mode it >>>>> works, but compiling mode still has errors: >>>>> >>>>> ? cat ./hello.erl >>>>> #!/usr/bin/env escript >>>>> %% -*- coding: utf-8 -*- >>>>> %%! +pc unicode >>>>> >>>>> -module(hello). >>>>> %-mode(compile). >>>>> -export([main/1, 'hello_??????_??'/0]). >>>>> >>>>> main(_) -> >>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>>> % 'hello_'(), >>>>> io:setopts([{encoding,unicode}]), >>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>>> 'hello_??????_??'(), >>>>> io:format("~tp~n", [{"Hello, ??, ??????"}]). >>>>> >>>>> 'hello_??????_??'() -> >>>>> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, >>>>> "Hello, ??; ??????"}]). >>>>> >>>>> ? erlang20 ./hello.erl >>>>> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} >>>>> {"Hello, ??, ??????"} >>>>> >>>>> If I uncomment the "-mode(compile)." line, it just runs into >>>>> compilation error (same as below shell compilation errors) >>>>> >>>>> Or in the Erlang shell, trying to compile it just failed: (I have to >>>>> remove (or comment out) the first "#!/usr/bin/env escript" line) >>>>> >>>>> ? erlang20 >>>>> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] >>>>> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] >>>>> >>>>> Eshell V9.0 (abort with ^G) >>>>> 1> c(hello). >>>>> hello.erl: internal error in beam_asm; >>>>> crash reason: badarg >>>>> >>>>> in function list_to_binary/1 >>>>> called as list_to_binary([[5,104,101,108,108,111], >>>>> [4,109,97,105,110], >>>>> [2,105,111], >>>>> [7,115,101,116,111,112,116,115], >>>>> [6,102,111,114,109,97,116], >>>>> >>>>> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028], >>>>> "\vmodule_info", >>>>> [6,101,114,108,97,110,103], >>>>> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) >>>>> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) >>>>> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) >>>>> in call from beam_asm:module/4 (beam_asm.erl, line 31) >>>>> in call from compile:beam_asm/1 (compile.erl, line 1370) >>>>> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, >>>>> line 329) >>>>> in call from compile:fold_comp/3 (compile.erl, line 355) >>>>> in call from compile:internal_comp/4 (compile.erl, line 339) >>>>> error >>>>> 2> >>>>> >>>>> I have looked up in many of the commit messages, still not seeing a >>>>> good example of how to use unicode in function names? Could some developer >>>>> behind this feature give more examples? >>>>> >>>>> https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Sat May 6 07:53:20 2017 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Sat, 06 May 2017 05:53:20 +0000 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: Good catch. I wonder why I can't trigger that branch though. Do you have by any chance any flag or option that is being set globally or that you pass to erlc that may affect compilation? -- *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Sat May 6 08:38:00 2017 From: bjorn@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Sat, 6 May 2017 08:38:00 +0200 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: The line numbers in the stacktrace don't make any sense. For example, line 213 is a comment, not executable code in commit 9ac8bdb. Therefore I suspect that you somewhere have an older version of beam_asm.beam that is somehow found instead of the correct one. You can use beam_asm:module_info(md5) to compute the MD5 and compare it with my output below. You could also try code:which(beam_asm) and make sure that the path is correct. $ bin/erl +pc unicode Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb19f] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.0 (abort with ^G) 1> c(hello). {ok,hello} 2> hello:main([]). {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} {"Hello, ??, ??????"} ok 3> beam_asm:module_info(md5). <<159,89,125,255,14,214,31,228,207,196,247,228,180,227,92, 181>> /Bj?rn On Sat, May 6, 2017 at 3:47 AM, derek wrote: > No; I built this from current `master@REDACTED`, it seems nothing changed, > either erlc or c() from erlang shell still doesn't compile > it prompts error in line 213 of beam_asm.erl, but line 213 of this file > doesn't have call to list_to_binary; as I read, it seems on #L245, the > list_to_binary doesn't work with this list string > `[16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44],` > because this string has chars (>255), it needs unicode:characters_to_binary > can work > https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L245 > > Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb] [64-bit] > [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.0 (abort with ^G) > 1> c(hello). > hello.erl: internal error in beam_asm; > crash reason: badarg > > in function list_to_binary/1 > called as list_to_binary([[5,104,101,108,108,111], > [4,109,97,105,110], > [2,105,111], > [7,115,101,116,111,112,116,115], > [6,102,111,114,109,97,116], > > [16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44], > "\vmodule_info", > [6,101,114,108,97,110,103], > [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) > in call from beam_asm:chunk/3 (beam_asm.erl, line 213) > in call from beam_asm:build_file/8 (beam_asm.erl, line 97) > in call from beam_asm:module/4 (beam_asm.erl, line 31) > in call from compile:beam_asm/1 (compile.erl, line 1370) > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line > 329) > in call from compile:fold_comp/3 (compile.erl, line 355) > in call from compile:internal_comp/4 (compile.erl, line 339) > error > 2> > list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). > ** exception error: bad argument > in function list_to_binary/1 > called as > list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076, > 95,19990,30028,44]) > 3> > unicode:characters_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). > <<16,104,101,108,108,111,95,209,142,208,189,208,184,208, > 186,208,190,208,180,95,228,184,150,231,149,140,44>> > > > > On Fri, May 5, 2017 at 5:35 AM Jos? Valim > wrote: >> >> I have ran the following on Erlang master, commit ffa80a4137: >> >> $ curl >> https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl >> | tail -n +2 > hello.erl >> $ erlc hello.erl >> >> And everything compiles just fine. Hopefully someone else can give it a >> try and let us know if they can reproduce the issue or not. >> >> >> >> >> Jos? Valim >> www.plataformatec.com.br >> Skype: jv.ptec >> Founder and Director of R&D >> >> On Thu, May 4, 2017 at 11:23 PM, derek wrote: >>> >>> like this gist? >>> https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9 >>> >>> On Thu, May 4, 2017 at 3:36 AM Jos? Valim >>> wrote: >>>> >>>> I have rebuilt Erlang from master and both the test and the code snippet >>>> you sent by e-mail works. In order to discard any encoding issue in the >>>> process, can you please push your code snippets to a repository? >>>> >>>> >>>> >>>> Jos? Valim >>>> www.plataformatec.com.br >>>> Skype: jv.ptec >>>> Founder and Director of R&D >>>> >>>> On Thu, May 4, 2017 at 8:04 AM, Jos? Valim >>>> wrote: >>>>> >>>>> Hi derek, >>>>> >>>>> I have sent a PR that improves the coverage around this feature: >>>>> https://github.com/erlang/otp/pull/1439 >>>>> >>>>> The test currently passes on an old master reference. I will rebuild my >>>>> development VM from master and follow up. >>>>> >>>>> >>>>> >>>>> Jos? Valim >>>>> www.plataformatec.com.br >>>>> Skype: jv.ptec >>>>> Founder and Director of R&D >>>>> >>>>> On Thu, May 4, 2017 at 1:11 AM, derek wrote: >>>>>> >>>>>> >>>>>> I found this feature from some of the merged PRs of Erlang/OTP 20 >>>>>> >>>>>> >>>>>> https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>>>>> https://github.com/erlang/otp/pulls?q=unicode >>>>>> >>>>>> > Erlang/OTP 20.0, atoms and function can contain Unicode characters >>>>>> >>>>>> so I built the binary from git checked out source code (from revision >>>>>> efcb91bce) and play with it: it seems in escript interpreting mode it works, >>>>>> but compiling mode still has errors: >>>>>> >>>>>> ? cat ./hello.erl >>>>>> #!/usr/bin/env escript >>>>>> %% -*- coding: utf-8 -*- >>>>>> %%! +pc unicode >>>>>> >>>>>> -module(hello). >>>>>> %-mode(compile). >>>>>> -export([main/1, 'hello_??????_??'/0]). >>>>>> >>>>>> main(_) -> >>>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>>>> % 'hello_'(), >>>>>> io:setopts([{encoding,unicode}]), >>>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), >>>>>> 'hello_??????_??'(), >>>>>> io:format("~tp~n", [{"Hello, ??, ??????"}]). >>>>>> >>>>>> 'hello_??????_??'() -> >>>>>> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, >>>>>> "Hello, ??; ??????"}]). >>>>>> >>>>>> ? erlang20 ./hello.erl >>>>>> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} >>>>>> {"Hello, ??, ??????"} >>>>>> >>>>>> If I uncomment the "-mode(compile)." line, it just runs into >>>>>> compilation error (same as below shell compilation errors) >>>>>> >>>>>> Or in the Erlang shell, trying to compile it just failed: (I have to >>>>>> remove (or comment out) the first "#!/usr/bin/env escript" line) >>>>>> >>>>>> ? erlang20 >>>>>> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] >>>>>> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] >>>>>> >>>>>> Eshell V9.0 (abort with ^G) >>>>>> 1> c(hello). >>>>>> hello.erl: internal error in beam_asm; >>>>>> crash reason: badarg >>>>>> >>>>>> in function list_to_binary/1 >>>>>> called as list_to_binary([[5,104,101,108,108,111], >>>>>> [4,109,97,105,110], >>>>>> [2,105,111], >>>>>> [7,115,101,116,111,112,116,115], >>>>>> [6,102,111,114,109,97,116], >>>>>> >>>>>> [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028], >>>>>> "\vmodule_info", >>>>>> [6,101,114,108,97,110,103], >>>>>> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) >>>>>> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) >>>>>> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) >>>>>> in call from beam_asm:module/4 (beam_asm.erl, line 31) >>>>>> in call from compile:beam_asm/1 (compile.erl, line 1370) >>>>>> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, >>>>>> line 329) >>>>>> in call from compile:fold_comp/3 (compile.erl, line 355) >>>>>> in call from compile:internal_comp/4 (compile.erl, line 339) >>>>>> error >>>>>> 2> >>>>>> >>>>>> I have looked up in many of the commit messages, still not seeing a >>>>>> good example of how to use unicode in function names? Could some developer >>>>>> behind this feature give more examples? >>>>>> >>>>>> https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 >>>>>> >>>>>> _______________________________________________ >>>>>> 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 > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bhuztez@REDACTED Sat May 6 10:08:28 2017 From: bhuztez@REDACTED (bhuztez) Date: Sat, 6 May 2017 16:08:28 +0800 Subject: [erlang-questions] [ANN] nezha - yet another paxos library in Erlang Message-ID: Hi all Nezha is a paxos library named after a notable character in the popular Chinese novel FengShen YanYi, along with Erlang Shen. Nezha has 3 heads and 8 arms, so he must have invented his own Paxos to decide what to do next. When I was trying to implement something a little bit more than a key-value store, I had looked for a library which is easy to get started with, to help create a prototype, so that I could get an idea of how should it be built. Unfortunately, I did not find one. Since I am an Erlang fanboy, I decided to write one in Erlang. Everybody are excited about Raft these days, and claim it is easy to understand. However, I found it very very complicated. After a few hours reading the paper, I still had no clue what it is talking about. Suddenly, I realized how simple paxos really is. Maybe this is the raft way to make paxos easier to understand. So right now, only the most simple variant of paxos as described in Paxos Made Simple, is implemented in Nezha. Nezha is available at https://github.com/bhuztez/nezha . Hope you will like it. Feel free to open an issue if you have any questions. From kuna.prime@REDACTED Sun May 7 19:34:00 2017 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 7 May 2017 19:34:00 +0200 Subject: [erlang-questions] number of modules limit? Message-ID: I am currently working on app that has potential to contain large number of modules > 10 000 these are mostly implementations of behaviours that are generated in runtime. My question is, what is most modules you have encountered in production in running erlang application, and is there practical limit on number of number of modules in system?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Sun May 7 21:19:06 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Sun, 07 May 2017 19:19:06 +0000 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: Yes, there are limits for both the number of modules (65536) and the number of exported functions (524288 = 8 functions/module for the maximum number of modules). See erlang:system_info(info) for details, and in particular look for the limits under the =index_table:module_code and =index_table:export_list sections. Cheers, Daniel On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: > I am currently working on app that has potential to contain large number > of modules > 10 000 > these are mostly implementations of behaviours that are generated in > runtime. > > My question is, what is most modules you have encountered in production in > running erlang application, and is there practical limit on number of > number of modules in system?? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Sun May 7 21:33:43 2017 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 7 May 2017 21:33:43 +0200 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: oh wow this limit is rather small !!! are there any suggestions how to work around it ? On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay wrote: > Yes, there are limits for both the number of modules (65536) and the > number of exported functions (524288 = 8 functions/module for the maximum > number of modules). > > See erlang:system_info(info) for details, and in particular look for the > limits under the =index_table:module_code and =index_table:export_list > sections. > > Cheers, > Daniel > > On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: > >> I am currently working on app that has potential to contain large number >> of modules > 10 000 >> these are mostly implementations of behaviours that are generated in >> runtime. >> >> My question is, what is most modules you have encountered in production >> in running erlang application, and is there practical limit on number of >> number of modules in system?? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gianfranco.alongi@REDACTED Sun May 7 21:49:03 2017 From: gianfranco.alongi@REDACTED (Gianfranco Alongi) Date: Sun, 7 May 2017 21:49:03 +0200 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: You could purge unused modules and just keep the minimum necessary set at all times? Otherwise create the needed functions during runtime as funs and keep them in an ets table? On May 7, 2017 20:33, "Karlo Kuna" wrote: oh wow this limit is rather small !!! are there any suggestions how to work around it ? On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay wrote: > Yes, there are limits for both the number of modules (65536) and the > number of exported functions (524288 = 8 functions/module for the maximum > number of modules). > > See erlang:system_info(info) for details, and in particular look for the > limits under the =index_table:module_code and =index_table:export_list > sections. > > Cheers, > Daniel > > On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: > >> I am currently working on app that has potential to contain large number >> of modules > 10 000 >> these are mostly implementations of behaviours that are generated in >> runtime. >> >> My question is, what is most modules you have encountered in production >> in running erlang application, and is there practical limit on number of >> number of modules in system?? >> _______________________________________________ >> 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 kuna.prime@REDACTED Sun May 7 21:53:34 2017 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 7 May 2017 21:53:34 +0200 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: permise is that all are used and i would rather have them already compiled then in funs but that is one options On Sun, May 7, 2017 at 9:49 PM, Gianfranco Alongi < gianfranco.alongi@REDACTED> wrote: > You could purge unused modules and just keep the minimum necessary set at > all times? > Otherwise create the needed functions during runtime as funs and keep them > in an ets table? > > > On May 7, 2017 20:33, "Karlo Kuna" wrote: > > oh wow this limit is rather small !!! > are there any suggestions how to work around it ? > > > On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay > wrote: > >> Yes, there are limits for both the number of modules (65536) and the >> number of exported functions (524288 = 8 functions/module for the maximum >> number of modules). >> >> See erlang:system_info(info) for details, and in particular look for the >> limits under the =index_table:module_code and =index_table:export_list >> sections. >> >> Cheers, >> Daniel >> >> On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: >> >>> I am currently working on app that has potential to contain large number >>> of modules > 10 000 >>> these are mostly implementations of behaviours that are generated in >>> runtime. >>> >>> My question is, what is most modules you have encountered in production >>> in running erlang application, and is there practical limit on number of >>> number of modules in system?? >>> _______________________________________________ >>> 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 fxn@REDACTED Sun May 7 22:14:21 2017 From: fxn@REDACTED (Xavier Noria) Date: Sun, 07 May 2017 20:14:21 +0000 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: Is the limit was per node, perhaps sharding them could be a workaround. (But I do not know if the premise holds.) On Sun, 7 May 2017 at 21:53, Karlo Kuna wrote: > permise is that all are used > > and i would rather have them already compiled then in funs but that is one > options > > On Sun, May 7, 2017 at 9:49 PM, Gianfranco Alongi < > gianfranco.alongi@REDACTED> wrote: > >> You could purge unused modules and just keep the minimum necessary set at >> all times? >> Otherwise create the needed functions during runtime as funs and keep >> them in an ets table? >> >> >> On May 7, 2017 20:33, "Karlo Kuna" wrote: >> >> oh wow this limit is rather small !!! >> are there any suggestions how to work around it ? >> >> >> On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay >> wrote: >> >>> Yes, there are limits for both the number of modules (65536) and the >>> number of exported functions (524288 = 8 functions/module for the maximum >>> number of modules). >>> >>> See erlang:system_info(info) for details, and in particular look for >>> the limits under the =index_table:module_code and >>> =index_table:export_list sections. >>> >>> Cheers, >>> Daniel >>> >>> On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: >>> >>>> I am currently working on app that has potential to contain large >>>> number of modules > 10 000 >>>> these are mostly implementations of behaviours that are generated in >>>> runtime. >>>> >>>> My question is, what is most modules you have encountered in production >>>> in running erlang application, and is there practical limit on number of >>>> number of modules in system?? >>>> _______________________________________________ >>>> 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 > -- Sent from Gmail Mobile -------------- next part -------------- An HTML attachment was scrubbed... URL: From denc716@REDACTED Sun May 7 23:36:21 2017 From: denc716@REDACTED (derek) Date: Sun, 07 May 2017 21:36:21 +0000 Subject: [erlang-questions] Erlang/OTP 20.0, atoms and function names with Unicode In-Reply-To: References: Message-ID: ok; so it seems because I have the ERL_LIBS pointing to a large directory of erlang libs that was taking precedence; if I run with `ERL_LIBS=./lib:$ERL_LIBS erl ...` then it works; thanks then here is a question about ERL_LIBS by the way: I am reading docs and code about current implementation, through #L85 "["."] ++ UserLibPaths ++ Paths;" it seems the code loading precedence is current dir "." >> all "*/ebin" from ERL_LIBS >> the "lib/*/ebin" from current ERL installation dir; 1. http://erlang.org/doc/man/code.html 2. https://github.com/erlang/otp/blob/master/lib/kernel/src/code_server.erl#L85-L86 I wonder should this be revised? to take ERL installation dir's "lib/*/ebin" precedence before extra ERL_LIBS ? or can we bring in another EXTRA_ERL_LIBS environment variable to be lookup after the "lib/*/ebin" from current ERL installation dir? On Fri, May 5, 2017 at 11:38 PM Bj?rn Gustavsson wrote: > The line numbers in the stacktrace don't make any sense. > For example, line 213 is a comment, not executable code > in commit 9ac8bdb. > > Therefore I suspect that you somewhere have an older > version of beam_asm.beam that is somehow found > instead of the correct one. > > You can use beam_asm:module_info(md5) to compute > the MD5 and compare it with my output below. > You could also try code:which(beam_asm) and make > sure that the path is correct. > > $ bin/erl +pc unicode > Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb19f] > [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] > [kernel-poll:false] > > Eshell V9.0 (abort with ^G) > 1> c(hello). > {ok,hello} > 2> hello:main([]). > {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} > {"Hello, ??, ??????"} > ok > 3> beam_asm:module_info(md5). > <<159,89,125,255,14,214,31,228,207,196,247,228,180,227,92, > 181>> > > /Bj?rn > > > On Sat, May 6, 2017 at 3:47 AM, derek wrote: > > No; I built this from current `master@REDACTED`, it seems nothing > changed, > > either erlc or c() from erlang shell still doesn't compile > > it prompts error in line 213 of beam_asm.erl, but line 213 of this file > > doesn't have call to list_to_binary; as I read, it seems on #L245, the > > list_to_binary doesn't work with this list string > > > `[16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44],` > > because this string has chars (>255), it needs > unicode:characters_to_binary > > can work > > > https://github.com/erlang/otp/blob/master/lib/compiler/src/beam_asm.erl#L245 > > > > Erlang/OTP 20 [RELEASE CANDIDATE 1] [erts-9.0] [source-9ac8bdb] [64-bit] > > [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] > > > > Eshell V9.0 (abort with ^G) > > 1> c(hello). > > hello.erl: internal error in beam_asm; > > crash reason: badarg > > > > in function list_to_binary/1 > > called as list_to_binary([[5,104,101,108,108,111], > > [4,109,97,105,110], > > [2,105,111], > > [7,115,101,116,111,112,116,115], > > [6,102,111,114,109,97,116], > > > > > [16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44], > > "\vmodule_info", > > [6,101,114,108,97,110,103], > > [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) > > in call from beam_asm:chunk/3 (beam_asm.erl, line 213) > > in call from beam_asm:build_file/8 (beam_asm.erl, line 97) > > in call from beam_asm:module/4 (beam_asm.erl, line 31) > > in call from compile:beam_asm/1 (compile.erl, line 1370) > > in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, > line > > 329) > > in call from compile:fold_comp/3 (compile.erl, line 355) > > in call from compile:internal_comp/4 (compile.erl, line 339) > > error > > 2> > > > list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). > > ** exception error: bad argument > > in function list_to_binary/1 > > called as > > list_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076, > > 95,19990,30028,44]) > > 3> > > > unicode:characters_to_binary([16,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028,44]). > > <<16,104,101,108,108,111,95,209,142,208,189,208,184,208, > > 186,208,190,208,180,95,228,184,150,231,149,140,44>> > > > > > > > > On Fri, May 5, 2017 at 5:35 AM Jos? Valim < > jose.valim@REDACTED> > > wrote: > >> > >> I have ran the following on Erlang master, commit ffa80a4137: > >> > >> $ curl > >> > https://gist.githubusercontent.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9/raw/cee893bbcd1e9ade6e145c7f66b8599ab9dd6959/hello.erl > >> | tail -n +2 > hello.erl > >> $ erlc hello.erl > >> > >> And everything compiles just fine. Hopefully someone else can give it a > >> try and let us know if they can reproduce the issue or not. > >> > >> > >> > >> > >> Jos? Valim > >> www.plataformatec.com.br > >> Skype: jv.ptec > >> Founder and Director of R&D > >> > >> On Thu, May 4, 2017 at 11:23 PM, derek wrote: > >>> > >>> like this gist? > >>> https://gist.github.com/anonymous/2e8babd349167a49eb6f6d55ec0505c9 > >>> > >>> On Thu, May 4, 2017 at 3:36 AM Jos? Valim > >>> wrote: > >>>> > >>>> I have rebuilt Erlang from master and both the test and the code > snippet > >>>> you sent by e-mail works. In order to discard any encoding issue in > the > >>>> process, can you please push your code snippets to a repository? > >>>> > >>>> > >>>> > >>>> Jos? Valim > >>>> www.plataformatec.com.br > >>>> Skype: jv.ptec > >>>> Founder and Director of R&D > >>>> > >>>> On Thu, May 4, 2017 at 8:04 AM, Jos? Valim > >>>> wrote: > >>>>> > >>>>> Hi derek, > >>>>> > >>>>> I have sent a PR that improves the coverage around this feature: > >>>>> https://github.com/erlang/otp/pull/1439 > >>>>> > >>>>> The test currently passes on an old master reference. I will rebuild > my > >>>>> development VM from master and follow up. > >>>>> > >>>>> > >>>>> > >>>>> Jos? Valim > >>>>> www.plataformatec.com.br > >>>>> Skype: jv.ptec > >>>>> Founder and Director of R&D > >>>>> > >>>>> On Thu, May 4, 2017 at 1:11 AM, derek wrote: > >>>>>> > >>>>>> > >>>>>> I found this feature from some of the merged PRs of Erlang/OTP 20 > >>>>>> > >>>>>> > >>>>>> > https://github.com/erlang/otp/blob/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 > >>>>>> https://github.com/erlang/otp/pulls?q=unicode > >>>>>> > >>>>>> > Erlang/OTP 20.0, atoms and function can contain Unicode characters > >>>>>> > >>>>>> so I built the binary from git checked out source code (from > revision > >>>>>> efcb91bce) and play with it: it seems in escript interpreting mode > it works, > >>>>>> but compiling mode still has errors: > >>>>>> > >>>>>> ? cat ./hello.erl > >>>>>> #!/usr/bin/env escript > >>>>>> %% -*- coding: utf-8 -*- > >>>>>> %%! +pc unicode > >>>>>> > >>>>>> -module(hello). > >>>>>> %-mode(compile). > >>>>>> -export([main/1, 'hello_??????_??'/0]). > >>>>>> > >>>>>> main(_) -> > >>>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), > >>>>>> % 'hello_'(), > >>>>>> io:setopts([{encoding,unicode}]), > >>>>>> % io:format("~p~n", [{io:printable_range(), io:getopts()}]), > >>>>>> 'hello_??????_??'(), > >>>>>> io:format("~tp~n", [{"Hello, ??, ??????"}]). > >>>>>> > >>>>>> 'hello_??????_??'() -> > >>>>>> io:format("~tp~n", [{'hello_??????', <<"Hello, ??; ??????"/utf8>>, > >>>>>> "Hello, ??; ??????"}]). > >>>>>> > >>>>>> ? erlang20 ./hello.erl > >>>>>> {'hello_??????',<<"Hello, ??; ??????"/utf8>>,"Hello, ??; ??????"} > >>>>>> {"Hello, ??, ??????"} > >>>>>> > >>>>>> If I uncomment the "-mode(compile)." line, it just runs into > >>>>>> compilation error (same as below shell compilation errors) > >>>>>> > >>>>>> Or in the Erlang shell, trying to compile it just failed: (I have to > >>>>>> remove (or comment out) the first "#!/usr/bin/env escript" line) > >>>>>> > >>>>>> ? erlang20 > >>>>>> Erlang/OTP 20 [DEVELOPMENT] [erts-9.0] [source-efcb91bce] [64-bit] > >>>>>> [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] > >>>>>> > >>>>>> Eshell V9.0 (abort with ^G) > >>>>>> 1> c(hello). > >>>>>> hello.erl: internal error in beam_asm; > >>>>>> crash reason: badarg > >>>>>> > >>>>>> in function list_to_binary/1 > >>>>>> called as list_to_binary([[5,104,101,108,108,111], > >>>>>> [4,109,97,105,110], > >>>>>> [2,105,111], > >>>>>> [7,115,101,116,111,112,116,115], > >>>>>> [6,102,111,114,109,97,116], > >>>>>> > >>>>>> > [15,104,101,108,108,111,95,1102,1085,1080,1082,1086,1076,95,19990,30028], > >>>>>> "\vmodule_info", > >>>>>> [6,101,114,108,97,110,103], > >>>>>> [15,103,101,116,95,109,111,100,117,108,101,95,105,110,102,111]]) > >>>>>> in call from beam_asm:chunk/3 (beam_asm.erl, line 213) > >>>>>> in call from beam_asm:build_file/8 (beam_asm.erl, line 97) > >>>>>> in call from beam_asm:module/4 (beam_asm.erl, line 31) > >>>>>> in call from compile:beam_asm/1 (compile.erl, line 1370) > >>>>>> in call from compile:'-internal_comp/4-anonymous-1-'/2 > (compile.erl, > >>>>>> line 329) > >>>>>> in call from compile:fold_comp/3 (compile.erl, line 355) > >>>>>> in call from compile:internal_comp/4 (compile.erl, line 339) > >>>>>> error > >>>>>> 2> > >>>>>> > >>>>>> I have looked up in many of the commit messages, still not seeing a > >>>>>> good example of how to use unicode in function names? Could some > developer > >>>>>> behind this feature give more examples? > >>>>>> > >>>>>> > https://github.com/erlang/otp/blame/master/lib/stdlib/doc/src/unicode_usage.xml#L66-L71 > >>>>>> > >>>>>> _______________________________________________ > >>>>>> 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 > > > > > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Mon May 8 07:11:38 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Mon, 08 May 2017 05:11:38 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe Message-ID: Hi, I've an Erlang application called tapp which was running perfectly as a service under Windows 10 "build 14393" (and earlier versions). Since Microsoft is forcing updates now, the app stopped working when I got the update build "15063". Here is the syslog error message I'm getting now: tapp Possible cyclic restarting of erlang machine. In the Windows's task manager, I can see that both erl.exe and conhost.exe get restarted every second. Does anyone notice this problem? Any idea for a fix? N.B: I'm using erts-8.2 /Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Mon May 8 08:27:36 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Mon, 08 May 2017 06:27:36 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Forgot to mention that the application is still working fine if started manually (i.e. console mode): c:\> bin\tapp.cmd console But not when started as a Windows service. /Frank wrote: > Hi, > > > I've an Erlang application called tapp which was running perfectly as a > service under Windows 10 "build 14393" (and earlier versions). > > > Since Microsoft is forcing updates now, the app stopped working when I got > the update build "15063". > > Here is the syslog error message I'm getting now: > > > > > > tapp > > Possible cyclic restarting of erlang machine. > > > > > > In the Windows's task manager, I can see that both erl.exe and conhost.exe get > restarted every second. > > > Does anyone notice this problem? Any idea for a fix? > > > N.B: I'm using erts-8.2 > > > /Frank > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leif.einar@REDACTED Mon May 8 11:31:52 2017 From: leif.einar@REDACTED (Leif Einar Aune) Date: Mon, 8 May 2017 09:31:52 +0000 Subject: [erlang-questions] ODBC and longtext limitation Message-ID: Hi list, We are using OTP18.3 on Centos towards a MySQL database using ODBC. When switching a column to LONGTEXT, ODBC type SQL_LONGVARCHAR, we noticed that the values were chopped off when reading from Erlang. Reading odbcserver.h and odbcserver.c in the erlang distribution this was no surprise, as the 'size' variable is set to MAXCOLSIZE (=8001). Increasing this define and recompiling the odbcserver fixed the limitation. Has anyone else experienced this limitation, and perhaps come up with a better solution? The solution feels wrong, since the maximum value of a LONGTEXT is rather big, and you do not want to malloc 4GB of memory for each LONGTEXT column. Best Regards Leif Einar Aune -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon May 8 12:30:51 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 08 May 2017 12:30:51 +0200 Subject: [erlang-questions] ODBC and longtext limitation In-Reply-To: References: Message-ID: Hi, Did you considered using blob and LONGVARBINARY instead ? This however imply use of temporary tables on some request at mysql side if I remember well. Regards "Envoy? depuis mon mobile " Eric ---- Leif Einar Aune a ?crit ---- >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Mon May 8 13:09:30 2017 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 8 May 2017 13:09:30 +0200 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: so anyone knows if this limit is per node? if it is then distributing modules on different node would be great option. On Sun, May 7, 2017 at 10:14 PM, Xavier Noria wrote: > Is the limit was per node, perhaps sharding them could be a workaround. > (But I do not know if the premise holds.) > > On Sun, 7 May 2017 at 21:53, Karlo Kuna wrote: > >> permise is that all are used >> >> and i would rather have them already compiled then in funs but that is >> one options >> >> On Sun, May 7, 2017 at 9:49 PM, Gianfranco Alongi < >> gianfranco.alongi@REDACTED> wrote: >> >>> You could purge unused modules and just keep the minimum necessary set >>> at all times? >>> Otherwise create the needed functions during runtime as funs and keep >>> them in an ets table? >>> >>> >>> On May 7, 2017 20:33, "Karlo Kuna" wrote: >>> >>> oh wow this limit is rather small !!! >>> are there any suggestions how to work around it ? >>> >>> >>> On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay >> > wrote: >>> >>>> Yes, there are limits for both the number of modules (65536) and the >>>> number of exported functions (524288 = 8 functions/module for the maximum >>>> number of modules). >>>> >>>> See erlang:system_info(info) for details, and in particular look for >>>> the limits under the =index_table:module_code and >>>> =index_table:export_list sections. >>>> >>>> Cheers, >>>> Daniel >>>> >>>> On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: >>>> >>>>> I am currently working on app that has potential to contain large >>>>> number of modules > 10 000 >>>>> these are mostly implementations of behaviours that are generated in >>>>> runtime. >>>>> >>>>> My question is, what is most modules you have encountered in >>>>> production in running erlang application, and is there practical limit on >>>>> number of number of modules in system?? >>>>> _______________________________________________ >>>>> 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 >> > -- > Sent from Gmail Mobile > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Mon May 8 13:26:02 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Mon, 08 May 2017 11:26:02 +0000 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: Yes, this is a per-node limit (just like almost all other VM limits). Distributing modules on different nodes would work. Be aware though that by default the nodes would try to form a fully connected mesh, so if you would like to run them all on the same host (and same IP) the next thing you will run out of will be TCP ports. So start these nodes as hidden and/or try to distribute them over multiple IP-s/hosts. Cheers, Daniel On Mon, 8 May 2017 at 13:09 Karlo Kuna wrote: > so anyone knows if this limit is per node? if it is then distributing > modules on different node would be great option. > > On Sun, May 7, 2017 at 10:14 PM, Xavier Noria wrote: > >> Is the limit was per node, perhaps sharding them could be a workaround. >> (But I do not know if the premise holds.) >> >> On Sun, 7 May 2017 at 21:53, Karlo Kuna wrote: >> >>> permise is that all are used >>> >>> and i would rather have them already compiled then in funs but that is >>> one options >>> >>> On Sun, May 7, 2017 at 9:49 PM, Gianfranco Alongi < >>> gianfranco.alongi@REDACTED> wrote: >>> >>>> You could purge unused modules and just keep the minimum necessary set >>>> at all times? >>>> Otherwise create the needed functions during runtime as funs and keep >>>> them in an ets table? >>>> >>>> >>>> On May 7, 2017 20:33, "Karlo Kuna" wrote: >>>> >>>> oh wow this limit is rather small !!! >>>> are there any suggestions how to work around it ? >>>> >>>> >>>> On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay < >>>> dszoboszlay@REDACTED> wrote: >>>> >>>>> Yes, there are limits for both the number of modules (65536) and the >>>>> number of exported functions (524288 = 8 functions/module for the maximum >>>>> number of modules). >>>>> >>>>> See erlang:system_info(info) for details, and in particular look for >>>>> the limits under the =index_table:module_code and >>>>> =index_table:export_list sections. >>>>> >>>>> Cheers, >>>>> Daniel >>>>> >>>>> On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: >>>>> >>>>>> I am currently working on app that has potential to contain large >>>>>> number of modules > 10 000 >>>>>> these are mostly implementations of behaviours that are generated in >>>>>> runtime. >>>>>> >>>>>> My question is, what is most modules you have encountered in >>>>>> production in running erlang application, and is there practical limit on >>>>>> number of number of modules in system?? >>>>>> _______________________________________________ >>>>>> 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 >>> >> -- >> Sent from Gmail Mobile >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.molteni@REDACTED Mon May 8 14:00:39 2017 From: marco.molteni@REDACTED (Marco Molteni) Date: Mon, 8 May 2017 14:00:39 +0200 Subject: [erlang-questions] ANN mock_io (mock Erlang I/O protocol) version 0.1.0 Message-ID: <355DC4CD-822E-4743-81E2-6EC96EDF3DCD@laposte.net> Hello, I am happy to announce mock_io, https://bitbucket.org/marco_m/mock_io A simple mock of the Erlang I/O protocol, to allow unit testing code that performs I/O operations (`io:fwrite`, `io:fread`, `file:read`, `file:write`, ...). By default, it mocks the `standard_io` device by manipulating the group leader, but you can mock any device/file. Focuses on simplicity and allowing painless mocking of I/O, not on performance. ## Usage examples ### Extracting output from UUT UUT: ```erlang -module(uut). write_to_stdout() -> io:fwrite("~p ~p ~s~n", [1, a, "ciao"]). ``` EUnit test: ```erlang capture_stdout_test() -> {IO, GL} = mock_io:setup(), uut:write_to_stdout(), ?assertEqual(<<"1 a ciao\n">>, mock_io:extract(IO)), mock_io:teardown({IO, GL}). ``` ### Injecting input to UUT UUT: ```erlang -module(uut). read_from_stdin() -> io:get_line("prompt"). ``` EUnit test: ```erlang inject_to_stdin_test() -> {IO, GL} = mock_io:setup(), mock_io:inject(IO, <<"pizza pazza puzza\n">>), ?assertEqual("pizza pazza puzza\n", uut:read_from_stdin()), ?assertEqual(<<>>, mock_io:remaining_input(IO)), mock_io:teardown({IO, GL}). ``` Hope people find this useful :-) marco From kuna.prime@REDACTED Mon May 8 14:23:40 2017 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 8 May 2017 14:23:40 +0200 Subject: [erlang-questions] number of modules limit? In-Reply-To: References: Message-ID: thank you for useful info this will be interesting to deal with On Mon, May 8, 2017 at 1:26 PM, D?niel Szoboszlay wrote: > Yes, this is a per-node limit (just like almost all other VM limits). > Distributing modules on different nodes would work. > > Be aware though that by default the nodes would try to form a fully > connected mesh, so if you would like to run them all on the same host (and > same IP) the next thing you will run out of will be TCP ports. So start > these nodes as hidden and/or try to distribute them over multiple > IP-s/hosts. > > Cheers, > Daniel > > On Mon, 8 May 2017 at 13:09 Karlo Kuna wrote: > >> so anyone knows if this limit is per node? if it is then distributing >> modules on different node would be great option. >> >> On Sun, May 7, 2017 at 10:14 PM, Xavier Noria wrote: >> >>> Is the limit was per node, perhaps sharding them could be a workaround. >>> (But I do not know if the premise holds.) >>> >>> On Sun, 7 May 2017 at 21:53, Karlo Kuna wrote: >>> >>>> permise is that all are used >>>> >>>> and i would rather have them already compiled then in funs but that is >>>> one options >>>> >>>> On Sun, May 7, 2017 at 9:49 PM, Gianfranco Alongi < >>>> gianfranco.alongi@REDACTED> wrote: >>>> >>>>> You could purge unused modules and just keep the minimum necessary set >>>>> at all times? >>>>> Otherwise create the needed functions during runtime as funs and keep >>>>> them in an ets table? >>>>> >>>>> >>>>> On May 7, 2017 20:33, "Karlo Kuna" wrote: >>>>> >>>>> oh wow this limit is rather small !!! >>>>> are there any suggestions how to work around it ? >>>>> >>>>> >>>>> On Sun, May 7, 2017 at 9:19 PM, D?niel Szoboszlay < >>>>> dszoboszlay@REDACTED> wrote: >>>>> >>>>>> Yes, there are limits for both the number of modules (65536) and the >>>>>> number of exported functions (524288 = 8 functions/module for the maximum >>>>>> number of modules). >>>>>> >>>>>> See erlang:system_info(info) for details, and in particular look for >>>>>> the limits under the =index_table:module_code and >>>>>> =index_table:export_list sections. >>>>>> >>>>>> Cheers, >>>>>> Daniel >>>>>> >>>>>> On Sun, 7 May 2017 at 19:34 Karlo Kuna wrote: >>>>>> >>>>>>> I am currently working on app that has potential to contain large >>>>>>> number of modules > 10 000 >>>>>>> these are mostly implementations of behaviours that are generated in >>>>>>> runtime. >>>>>>> >>>>>>> My question is, what is most modules you have encountered in >>>>>>> production in running erlang application, and is there practical limit on >>>>>>> number of number of modules in system?? >>>>>>> _______________________________________________ >>>>>>> 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 >>>> >>> -- >>> Sent from Gmail Mobile >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellkvist@REDACTED Mon May 8 14:54:08 2017 From: hellkvist@REDACTED (Stefan Hellkvist) Date: Mon, 8 May 2017 14:54:08 +0200 Subject: [erlang-questions] This clause cannot match because.... Message-ID: Hi all, I was just struck by a bug in my code due to wrong ordering of clauses. Given a function f/1 which could be simplified to something like this: f([a, B]) -> B; f([a, b]) -> will_never_happen. The problem is that the clause f([a, b]) is never taken simply because it is fully covered by the first clause which matches all values for the second element in the list. If I had put the second clause before the more general clause it would have worked the way I thought it should. I'm curious though. Why did the compiler not spot the problem in the code for f/1 when it can obviously spot the problem in a, to me at least, similar function f/2 seen below?: f(a, B) -> B; f(a, b) -> will_never_happen. In this example, (f/2), I get a compilation error with a very good and detailed description of what the problem is, but in the first case (f/1) the compiler does not see the problem (or cannot?) with the covering clause. Is this some edge case where the compiler has just stopped caring and I must use dialyser to spot the problem at an earlier stage than at runtime? Stefan p.s. funny thing is that if I use a tuple instead of a list to create f/1 in the same way the compiler is once again able to spot the problem, but not with a list as argument. -------------- next part -------------- An HTML attachment was scrubbed... URL: From leif.einar@REDACTED Mon May 8 14:12:07 2017 From: leif.einar@REDACTED (Leif Einar Aune) Date: Mon, 8 May 2017 12:12:07 +0000 Subject: [erlang-questions] ODBC and longtext limitation In-Reply-To: References: Message-ID: Thanks for the tip, but BLOBs have the same error ? from the source code (lib/odbc/c_src/odbcserver.c): if(sql_type == SQL_LONGVARCHAR || sql_type == SQL_LONGVARBINARY || sql_type == SQL_WLONGVARCHAR) size = MAXCOLSIZE; So BLOBs will be chopped off as well ? Best Regards Leif Einar From: ?ric Pailleau [mailto:eric.pailleau@REDACTED] Sent: mandag 8. mai 2017 12.31 To: Erlang Questions ; Leif Einar Aune Subject: Re: [erlang-questions] ODBC and longtext limitation Hi, Did you considered using blob and LONGVARBINARY instead ? This however imply use of temporary tables on some request at mysql side if I remember well. Regards "Envoy? depuis mon mobile " Eric ---- Leif Einar Aune a ?crit ---- Hi list, We are using OTP18.3 on Centos towards a MySQL database using ODBC. When switching a column to LONGTEXT, ODBC type SQL_LONGVARCHAR, we noticed that the values were chopped off when reading from Erlang. Reading odbcserver.h and odbcserver.c in the erlang distribution this was no surprise, as the ?size? variable is set to MAXCOLSIZE (=8001). Increasing this define and recompiling the odbcserver fixed the limitation. Has anyone else experienced this limitation, and perhaps come up with a better solution? The solution feels wrong, since the maximum value of a LONGTEXT is rather big, and you do not want to malloc 4GB of memory for each LONGTEXT column. Best Regards Leif Einar Aune -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Mon May 8 15:14:02 2017 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Mon, 8 May 2017 15:14:02 +0200 Subject: [erlang-questions] enif_select() questions In-Reply-To: References: Message-ID: On 05/05/2017 09:00 PM, Daniel Goertzen wrote: > - When the resource stop() callback is invoked with is_direct_call==false, > is the provided environment considered a "process" environment? (ie, should > I pass it as the first parameter to enif_send() or leave null?) Same > question for resource down() callback. As a general rule you should pass the environment that you got passed to your NIF or callback function. Pass NULL when you don't have an environment which is only in a created thread. Maybe the documentation should be changed to talk about "calling context" environments vs "dynamic term" environments or something like that. The idea with the is_direct_call argument was to make lock handling easier. If the resource has a mutex protecting its data, then enif_select can be called without unlocking the mutex and use is_direct_call to determine if the mutex is already locked or not. > - enif_select() appears to not add a reference to the associated resource. > What should happen if the resource gets garbage collected (dtor invoked) > while it has outstanding an enif_select()? > > enif_select *does* add a reference to the resource in the first call and it releases the reference after the stop callback has returned. https://github.com/erlang/otp/blob/OTP-20.0-rc1/erts/emulator/sys/common/erl_check_io.c#L1352 enif_monitor_process, however, does not add a reference to the resource. Suggestions of how to improve the documentation is always welcome. /Sverker, Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon May 8 16:44:13 2017 From: comptekki@REDACTED (Wes James) Date: Mon, 8 May 2017 08:44:13 -0600 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: I'm installing it now to see how it works with my erl service. If you need your application working, you can select the option to go back to previous build of windows 10. And wait until the new windows build gets out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first place, so...... -wes On Sun, May 7, 2017 at 11:11 PM, Frank Muller wrote: > Hi, > > > I've an Erlang application called tapp which was running perfectly as a > service under Windows 10 "build 14393" (and earlier versions). > > > Since Microsoft is forcing updates now, the app stopped working when I got > the update build "15063". > > Here is the syslog error message I'm getting now: > > > > > > tapp > > Possible cyclic restarting of erlang machine. > > > > > > In the Windows's task manager, I can see that both erl.exe and conhost.exe get > restarted every second. > > > Does anyone notice this problem? Any idea for a fix? > > > N.B: I'm using erts-8.2 > > > /Frank > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon May 8 17:45:49 2017 From: comptekki@REDACTED (Wes James) Date: Mon, 8 May 2017 09:45:49 -0600 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: I just finished installing the 15063 update and the app I had installed via erlsrv is still running fine. With windows 10, in the first place, to get an erl app running as a service, i've had to set the service as Automatic (delayed start), but to speed that up I added the registry entry AutoStartDelay with decimal 1 value (1 second). You can see the script I use here: https://github.com/comptekki/esysman . It's the win-erlsrv-installer.cmd script. -wes On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: > I'm installing it now to see how it works with my erl service. If you > need your application working, you can select the option to go back to > previous build of windows 10. And wait until the new windows build gets > out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first > place, so...... > > -wes > > On Sun, May 7, 2017 at 11:11 PM, Frank Muller > wrote: > >> Hi, >> >> >> I've an Erlang application called tapp which was running perfectly as a >> service under Windows 10 "build 14393" (and earlier versions). >> >> >> Since Microsoft is forcing updates now, the app stopped working when I >> got the update build "15063". >> >> Here is the syslog error message I'm getting now: >> >> >> >> >> >> tapp >> >> Possible cyclic restarting of erlang machine. >> >> >> >> >> >> In the Windows's task manager, I can see that both erl.exe and >> conhost.exe get restarted every second. >> >> >> Does anyone notice this problem? Any idea for a fix? >> >> >> N.B: I'm using erts-8.2 >> >> >> /Frank >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Mon May 8 18:13:33 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Mon, 08 May 2017 16:13:33 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Hi James, Thank you. I'll try in few minutes and I'll let you know. Question: is there a way to set these parameters via erlsrv.exe? /Frank wrote : > I just finished installing the 15063 update and the app I had installed > via erlsrv is still running fine. With windows 10, in the first place, to > get an erl app running as a service, i've had to set the service as > Automatic (delayed start), but to speed that up I added the registry entry > AutoStartDelay with decimal 1 value (1 second). You can see the script I > use here: https://github.com/comptekki/esysman . It's > the win-erlsrv-installer.cmd script. > > -wes > > On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: > >> I'm installing it now to see how it works with my erl service. If you >> need your application working, you can select the option to go back to >> previous build of windows 10. And wait until the new windows build gets >> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >> place, so...... >> >> -wes >> >> On Sun, May 7, 2017 at 11:11 PM, Frank Muller > > wrote: >> >>> Hi, >>> >>> >>> I've an Erlang application called tapp which was running perfectly as a >>> service under Windows 10 "build 14393" (and earlier versions). >>> >>> >>> Since Microsoft is forcing updates now, the app stopped working when I >>> got the update build "15063". >>> >>> Here is the syslog error message I'm getting now: >>> >>> >>> >>> >>> >>> tapp >>> >>> Possible cyclic restarting of erlang machine. >>> >>> >>> >>> >>> >>> In the Windows's task manager, I can see that both erl.exe and >>> conhost.exe get restarted every second. >>> >>> >>> Does anyone notice this problem? Any idea for a fix? >>> >>> >>> N.B: I'm using erts-8.2 >>> >>> >>> /Frank >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon May 8 18:46:07 2017 From: comptekki@REDACTED (Wes James) Date: Mon, 8 May 2017 10:46:07 -0600 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: The only params you can set via erlsrv, are on this page http://erlang.org/doc/man/erlsrv.html . I don't think you can manipulate the automatic delay or delay time with erlsrv. Maybe something they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 (9.0) and they both work. -wes On Mon, May 8, 2017 at 10:13 AM, Frank Muller wrote: > Hi James, > > Thank you. I'll try in few minutes and I'll let you know. > > Question: is there a way to set these parameters via erlsrv.exe? > > /Frank > > wrote : > > I just finished installing the 15063 update and the app I had installed >> via erlsrv is still running fine. With windows 10, in the first place, to >> get an erl app running as a service, i've had to set the service as >> Automatic (delayed start), but to speed that up I added the registry entry >> AutoStartDelay with decimal 1 value (1 second). You can see the script I >> use here: https://github.com/comptekki/esysman . It's >> the win-erlsrv-installer.cmd script. >> >> -wes >> >> On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: >> >>> I'm installing it now to see how it works with my erl service. If you >>> need your application working, you can select the option to go back to >>> previous build of windows 10. And wait until the new windows build gets >>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>> place, so...... >>> >>> -wes >>> >>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>> frank.muller.erl@REDACTED> wrote: >>> >>>> Hi, >>>> >>>> >>>> I've an Erlang application called tapp which was running perfectly as >>>> a service under Windows 10 "build 14393" (and earlier versions). >>>> >>>> >>>> Since Microsoft is forcing updates now, the app stopped working when I >>>> got the update build "15063". >>>> >>>> Here is the syslog error message I'm getting now: >>>> >>>> >>>> >>>> >>>> >>>> tapp >>>> >>>> Possible cyclic restarting of erlang machine. >>>> >>>> >>>> >>>> >>>> >>>> In the Windows's task manager, I can see that both erl.exe and >>>> conhost.exe get restarted every second. >>>> >>>> >>>> Does anyone notice this problem? Any idea for a fix? >>>> >>>> >>>> N.B: I'm using erts-8.2 >>>> >>>> >>>> /Frank >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kelvin.poon@REDACTED Mon May 8 19:11:16 2017 From: kelvin.poon@REDACTED (Kelvin Poon (Scotiabank GBM)) Date: Mon, 8 May 2017 17:11:16 +0000 Subject: [erlang-questions] Erlang Install on i368-pc-sollaris2.10 issues (Updated) Message-ID: <0C408DB7181F8F4DAD08D9C309E0BE717A5DB30B@SCTORMAIL102.scglobal.ad.scotiacapital.com> Hi, I am running into an issue with an Erlang install on our Unix machine (Solaris 10). Erlang version: R16B03 OS: Solaris 10 GCC: 4.8.2 GNU Make: 3.81 I am following the steps listed on the official install page: https://github.com/erlang/otp/blob/maint/HOWTO/INSTALL.md I have unpacked the tar file from erlang.org, these are the steps I have followed: export ERL_TOP=/otp_src_R16B03 export DED_LD=gcc #using gcc located at /usr/sfw/bin/gcc export PATH=/usr/sfw/bin:/usr/xpg4/bin/:/bin export DED_LDFLAGS=-shared ./configure -prefix= Configuration finished with: (I can post the entire output if necessary) ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* odbc : ODBC library - link check failed ********************************************************************* ********************************************************************* ********************** APPLICATIONS INFORMATION ******************* ********************************************************************* wx : wxWidgets not found, wx will NOT be usable ********************************************************************* ********************************************************************* ********************** DOCUMENTATION INFORMATION ****************** ********************************************************************* documentation : fop is missing. Using fakefop to generate placeholder PDF files. --- Then I ran make as instructed in the install instructions gmake #located at /usr/sfw/bin/gmake The error I receive is: /usr/ucb/install -c -d ../priv/lib/i386-pc-solaris2.10 gcc -shared -o ../priv/lib/i386-pc-solaris2.10/crypto.so ../priv/obj/i386-pc-solaris2.10/crypto.o /usr/lib -L/usr/lib -lcrypto ld: fatal: file /usr/lib: unknown file type ld: fatal: file processing errors. No output written to ../priv/lib/i386-pc-solaris2.10/crypto.so collect2: ld returned 1 exit status I don't understand why the make file would produce such a command, why is /usr/lib targeted there? It looks like it is following the generated makefile from $ERL_TOP/lib/crypto/c_src/Makefile.in, the corresponding makefile contain this: $(LIBDIR)/crypto$(TYPEMARKER).so: $(CRYPTO_OBJS) $(V_at)$(INSTALL_DIR) $(LIBDIR) $(V_LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(CRYPTO_LINK_LIB) Looks like something is wrong with the $LDLIBS variable. Does anybody know what's wrong? Thanks This e-mail and any attachments may contain confidential or privileged information. If you are not an intended recipient, do not re-send, copy or use this e-mail. Please also contact the sender immediately and delete this e-mail in its entirety. Privilege is not waived by reason of mistaken delivery to you. The Bank of Nova Scotia (Scotiabank) and its affiliates accept no liability whatsoever for loss or damage in relation to this e-mail and may monitor, retain and/or review email. Opinions expressed in this e-mail are those of the author and may not represent the opinions of The Bank of Nova Scotia (Scotiabank) and its affiliates. Trading instructions received by e-mail or voicemail will not be acted upon. To unsubscribe from receiving further Commercial Electronic Messages click here [https://www.unsubscribe.gbm.scotiabank.com/]. Pour obtenir la traduction en fran?ais: http://www.gbm.scotiabank.com/EmailDisclaimer/French.htm Traducci?n en espa?ol: http://www.gbm.scotiabank.com/EmailDisclaimer/Spanish.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Mon May 8 21:35:50 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Mon, 08 May 2017 19:35:50 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Same problem even after setting Delayed-Start. James, can you please test with erl-8.2 ? /Frank wrote : > The only params you can set via erlsrv, are on this page > http://erlang.org/doc/man/erlsrv.html . I don't think you can manipulate > the automatic delay or delay time with erlsrv. Maybe something they could > add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 (9.0) and > they both work. > > -wes > > > > > On Mon, May 8, 2017 at 10:13 AM, Frank Muller > wrote: > >> Hi James, >> >> Thank you. I'll try in few minutes and I'll let you know. >> >> Question: is there a way to set these parameters via erlsrv.exe? >> >> /Frank >> >> wrote : >> >> I just finished installing the 15063 update and the app I had installed >>> via erlsrv is still running fine. With windows 10, in the first place, to >>> get an erl app running as a service, i've had to set the service as >>> Automatic (delayed start), but to speed that up I added the registry entry >>> AutoStartDelay with decimal 1 value (1 second). You can see the script I >>> use here: https://github.com/comptekki/esysman . It's >>> the win-erlsrv-installer.cmd script. >>> >>> -wes >>> >>> On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: >>> >>>> I'm installing it now to see how it works with my erl service. If you >>>> need your application working, you can select the option to go back to >>>> previous build of windows 10. And wait until the new windows build gets >>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>> place, so...... >>>> >>>> -wes >>>> >>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>> frank.muller.erl@REDACTED> wrote: >>>> >>>>> Hi, >>>>> >>>>> >>>>> I've an Erlang application called tapp which was running perfectly as >>>>> a service under Windows 10 "build 14393" (and earlier versions). >>>>> >>>>> >>>>> Since Microsoft is forcing updates now, the app stopped working when I >>>>> got the update build "15063". >>>>> >>>>> Here is the syslog error message I'm getting now: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> tapp >>>>> >>>>> Possible cyclic restarting of erlang machine. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> In the Windows's task manager, I can see that both erl.exe and >>>>> conhost.exe get restarted every second. >>>>> >>>>> >>>>> Does anyone notice this problem? Any idea for a fix? >>>>> >>>>> >>>>> N.B: I'm using erts-8.2 >>>>> >>>>> >>>>> /Frank >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon May 8 21:49:32 2017 From: comptekki@REDACTED (Wes James) Date: Mon, 8 May 2017 13:49:32 -0600 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: I'll try 8.2. On Mon, May 8, 2017 at 1:35 PM, Frank Muller wrote: > Same problem even after setting Delayed-Start. > James, can you please test with erl-8.2 ? > > /Frank > > wrote : > > The only params you can set via erlsrv, are on this page >> http://erlang.org/doc/man/erlsrv.html . I don't think you can >> manipulate the automatic delay or delay time with erlsrv. Maybe something >> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >> (9.0) and they both work. >> >> -wes >> >> >> >> >> On Mon, May 8, 2017 at 10:13 AM, Frank Muller > > wrote: >> >>> Hi James, >>> >>> Thank you. I'll try in few minutes and I'll let you know. >>> >>> Question: is there a way to set these parameters via erlsrv.exe? >>> >>> /Frank >>> >>> wrote : >>> >>> I just finished installing the 15063 update and the app I had installed >>>> via erlsrv is still running fine. With windows 10, in the first place, to >>>> get an erl app running as a service, i've had to set the service as >>>> Automatic (delayed start), but to speed that up I added the registry entry >>>> AutoStartDelay with decimal 1 value (1 second). You can see the script I >>>> use here: https://github.com/comptekki/esysman . It's >>>> the win-erlsrv-installer.cmd script. >>>> >>>> -wes >>>> >>>> On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: >>>> >>>>> I'm installing it now to see how it works with my erl service. If you >>>>> need your application working, you can select the option to go back to >>>>> previous build of windows 10. And wait until the new windows build gets >>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>> place, so...... >>>>> >>>>> -wes >>>>> >>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>> frank.muller.erl@REDACTED> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> >>>>>> I've an Erlang application called tapp which was running perfectly >>>>>> as a service under Windows 10 "build 14393" (and earlier versions). >>>>>> >>>>>> >>>>>> Since Microsoft is forcing updates now, the app stopped working when >>>>>> I got the update build "15063". >>>>>> >>>>>> Here is the syslog error message I'm getting now: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> tapp >>>>>> >>>>>> Possible cyclic restarting of erlang machine. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>> conhost.exe get restarted every second. >>>>>> >>>>>> >>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>> >>>>>> >>>>>> N.B: I'm using erts-8.2 >>>>>> >>>>>> >>>>>> /Frank >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>>> >>>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon May 8 22:24:08 2017 From: comptekki@REDACTED (Wes James) Date: Mon, 8 May 2017 14:24:08 -0600 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: erl 8.2 is running normally for me. I've never had restart issues like you mentioned for any erl realease back to at least otp 17.x. -wes On Mon, May 8, 2017 at 1:35 PM, Frank Muller wrote: > Same problem even after setting Delayed-Start. > James, can you please test with erl-8.2 ? > > /Frank > > wrote : > > The only params you can set via erlsrv, are on this page >> http://erlang.org/doc/man/erlsrv.html . I don't think you can >> manipulate the automatic delay or delay time with erlsrv. Maybe something >> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >> (9.0) and they both work. >> >> -wes >> >> >> >> >> On Mon, May 8, 2017 at 10:13 AM, Frank Muller > > wrote: >> >>> Hi James, >>> >>> Thank you. I'll try in few minutes and I'll let you know. >>> >>> Question: is there a way to set these parameters via erlsrv.exe? >>> >>> /Frank >>> >>> wrote : >>> >>> I just finished installing the 15063 update and the app I had installed >>>> via erlsrv is still running fine. With windows 10, in the first place, to >>>> get an erl app running as a service, i've had to set the service as >>>> Automatic (delayed start), but to speed that up I added the registry entry >>>> AutoStartDelay with decimal 1 value (1 second). You can see the script I >>>> use here: https://github.com/comptekki/esysman . It's >>>> the win-erlsrv-installer.cmd script. >>>> >>>> -wes >>>> >>>> On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: >>>> >>>>> I'm installing it now to see how it works with my erl service. If you >>>>> need your application working, you can select the option to go back to >>>>> previous build of windows 10. And wait until the new windows build gets >>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>> place, so...... >>>>> >>>>> -wes >>>>> >>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>> frank.muller.erl@REDACTED> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> >>>>>> I've an Erlang application called tapp which was running perfectly >>>>>> as a service under Windows 10 "build 14393" (and earlier versions). >>>>>> >>>>>> >>>>>> Since Microsoft is forcing updates now, the app stopped working when >>>>>> I got the update build "15063". >>>>>> >>>>>> Here is the syslog error message I'm getting now: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> tapp >>>>>> >>>>>> Possible cyclic restarting of erlang machine. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>> conhost.exe get restarted every second. >>>>>> >>>>>> >>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>> >>>>>> >>>>>> N.B: I'm using erts-8.2 >>>>>> >>>>>> >>>>>> /Frank >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>>> >>>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Mon May 8 23:38:01 2017 From: rvirding@REDACTED (Robert Virding) Date: Mon, 8 May 2017 23:38:01 +0200 Subject: [erlang-questions] Exit signals are funny things In-Reply-To: References: <944CF35A-4F32-4BDE-9DA2-F8C18AFEEFE7@gmail.com> Message-ID: Yes, I know but the problem is still there. And I still get annoyed with the inconsistency every time I think about it. :-) Robert On 5 May 2017 at 21:35, Richard Carlsson wrote: > This stuff has been up several times before. Here's one from 2009 where I > looked into it: > http://erlang.org/pipermail/erlang-questions/2009-October/047190.html > > Then there's this one from 2010 where Robert answered: http://erlang.org/ > pipermail/erlang-questions/2010-December/055003.html > > And here's one from 2015 started by Robert: http://erlang.org/ > pipermail/erlang-questions/2015-October/086289.html > > /Richard > > > > /Richard > > 2017-05-05 14:32 GMT+02:00 Robert Virding : > >> Yes, and no. When a process dies with a reason then that reason is sent >> in a signal to all the processes in the link set. So if the process dies >> with the reason 'foo' then a 'foo' exit signal will be sent, and if I do >> exit/2 to send a 'foo' exit signal then a 'foo' exit signal will be sent. >> In both cases, if the receiving process is not trapping it will die with >> the reason 'foo' [*] and if the receiving process is trapping then the exit >> signal will be converted to a message with reason 'foo'. In both cases it >> IS a 'foo' exit signal. >> >> However, if the exit reason is 'kill' then the 'kill' exit signal sent >> from the process will be trapped while if it is sent with exit/2 it is not >> trappable. THIS IS THE ONLY EXIT SIGNAL WHICH BEHAVES DIFFERENTLY! [**] >> >> Again where's the logic in that? Why the inconsistency? We tried hard >> back in the old days to be consistent. >> >> Robert >> >> * As 'foo' is not the value 'normal' it will kill the process. >> **Sorry of raising my voice. >> >> >> On 5 May 2017 at 14:08, Alex S. wrote: >> >>> There is exit/1 and exit/2 which are very, very different things. exit/1 >>> is NOT an exit signal. >>> There is no ?kill and kill?, there is exit signal kill, which is >>> special, and exit reason kill, which is not special. >>> > 5 ??? 2017 ?., ? 15:05, Robert Virding >>> ???????(?): >>> > >>> > There is more. So: >>> > >>> > 1> process_flag(trap_exit, true). >>> > false >>> > 2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), >>> timer:sleep(infinity) end). >>> > <0.60.0> >>> > >>> > We trap exits and spawn_link which also traps exits and just hangs >>> there waiting. >>> > >>> > 3> spawn(fun() -> link(Pid), exit(kill) end). >>> > <0.62.0> >>> > 4> process_info(Pid, messages). >>> > {messages,[{'EXIT',<0.62.0>,kill}]} >>> > >>> > Now we spawn a new process which links to our hanger and exits with >>> the reason 'kill'. We can then check our hanger and see that it received a >>> 'kill' signal which it converted to a message because it was trapping. >>> Finally: >>> > >>> > 5> spawn(fun() -> exit(Pid, kill) end). >>> > <0.65.0> >>> > 6> flush(). >>> > Shell got {'EXIT',<0.60.0>,killed} >>> > ok >>> > >>> > we spawn another process which uses exit/2 to send a 'kill' signal to >>> our hanger and in this case it cannot trap the signal and dies with the >>> reason 'killed'. So there is 'kill' and 'kill' depending on how I send it. >>> > >>> > Where's the logic in that? >>> > >>> > Robert >>> > >>> > P.S. Yes, I know that getting a 'killed' from a process which has been >>> killed with a 'kill' signal is the correct. >>> > >>> > _______________________________________________ >>> > 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 frank.muller.erl@REDACTED Tue May 9 05:00:09 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Tue, 09 May 2017 03:00:09 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Hi James, You really saved my day. After copying your exact settings, it's working perfectly now. Thanks again. /Frank wrote : > erl 8.2 is running normally for me. I've never had restart issues like > you mentioned for any erl realease back to at least otp 17.x. > > -wes > > On Mon, May 8, 2017 at 1:35 PM, Frank Muller > wrote: > >> Same problem even after setting Delayed-Start. >> James, can you please test with erl-8.2 ? >> >> /Frank >> >> wrote : >> >> The only params you can set via erlsrv, are on this page >>> http://erlang.org/doc/man/erlsrv.html . I don't think you can >>> manipulate the automatic delay or delay time with erlsrv. Maybe something >>> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >>> (9.0) and they both work. >>> >>> -wes >>> >>> >>> >>> >>> On Mon, May 8, 2017 at 10:13 AM, Frank Muller < >>> frank.muller.erl@REDACTED> wrote: >>> >>>> Hi James, >>>> >>>> Thank you. I'll try in few minutes and I'll let you know. >>>> >>>> Question: is there a way to set these parameters via erlsrv.exe? >>>> >>>> /Frank >>>> >>>> wrote : >>>> >>>> I just finished installing the 15063 update and the app I had installed >>>>> via erlsrv is still running fine. With windows 10, in the first place, to >>>>> get an erl app running as a service, i've had to set the service as >>>>> Automatic (delayed start), but to speed that up I added the registry entry >>>>> AutoStartDelay with decimal 1 value (1 second). You can see the script I >>>>> use here: https://github.com/comptekki/esysman . It's >>>>> the win-erlsrv-installer.cmd script. >>>>> >>>>> -wes >>>>> >>>>> On Mon, May 8, 2017 at 8:44 AM, Wes James wrote: >>>>> >>>>>> I'm installing it now to see how it works with my erl service. If >>>>>> you need your application working, you can select the option to go back to >>>>>> previous build of windows 10. And wait until the new windows build gets >>>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>>> place, so...... >>>>>> >>>>>> -wes >>>>>> >>>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>>> frank.muller.erl@REDACTED> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> >>>>>>> I've an Erlang application called tapp which was running perfectly >>>>>>> as a service under Windows 10 "build 14393" (and earlier versions). >>>>>>> >>>>>>> >>>>>>> Since Microsoft is forcing updates now, the app stopped working when >>>>>>> I got the update build "15063". >>>>>>> >>>>>>> Here is the syslog error message I'm getting now: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> tapp >>>>>>> >>>>>>> Possible cyclic restarting of erlang machine. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>>> conhost.exe get restarted every second. >>>>>>> >>>>>>> >>>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>>> >>>>>>> >>>>>>> N.B: I'm using erts-8.2 >>>>>>> >>>>>>> >>>>>>> /Frank >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>>> >>>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Tue May 9 06:03:33 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Tue, 09 May 2017 04:03:33 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Now, stopping the service takes around 30sec to finish with this message (in System Events Viewer): tapp: StopAction did not terminate Erlang. Trying forced kill. I've defined my stop-action as: "init:stop()." Any idea? /Frank wrote : > Hi James, > > You really saved my day. After copying your exact settings, it's working > perfectly now. > > Thanks again. > > /Frank > > wrote : > > erl 8.2 is running normally for me. I've never had restart issues like >> you mentioned for any erl realease back to at least otp 17.x. >> >> -wes >> >> On Mon, May 8, 2017 at 1:35 PM, Frank Muller >> wrote: >> >>> Same problem even after setting Delayed-Start. >>> James, can you please test with erl-8.2 ? >>> >>> /Frank >>> >>> wrote : >>> >>> The only params you can set via erlsrv, are on this page >>>> http://erlang.org/doc/man/erlsrv.html . I don't think you can >>>> manipulate the automatic delay or delay time with erlsrv. Maybe something >>>> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >>>> (9.0) and they both work. >>>> >>>> -wes >>>> >>>> >>>> >>>> >>>> On Mon, May 8, 2017 at 10:13 AM, Frank Muller < >>>> frank.muller.erl@REDACTED> wrote: >>>> >>>>> Hi James, >>>>> >>>>> Thank you. I'll try in few minutes and I'll let you know. >>>>> >>>>> Question: is there a way to set these parameters via erlsrv.exe? >>>>> >>>>> /Frank >>>>> >>>>> wrote : >>>>> >>>>> I just finished installing the 15063 update and the app I had >>>>>> installed via erlsrv is still running fine. With windows 10, in the first >>>>>> place, to get an erl app running as a service, i've had to set the service >>>>>> as Automatic (delayed start), but to speed that up I added the registry >>>>>> entry AutoStartDelay with decimal 1 value (1 second). You can see the >>>>>> script I use here: https://github.com/comptekki/esysman . It's >>>>>> the win-erlsrv-installer.cmd script. >>>>>> >>>>>> -wes >>>>>> >>>>>> On Mon, May 8, 2017 at 8:44 AM, Wes James >>>>>> wrote: >>>>>> >>>>>>> I'm installing it now to see how it works with my erl service. If >>>>>>> you need your application working, you can select the option to go back to >>>>>>> previous build of windows 10. And wait until the new windows build gets >>>>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>>>> place, so...... >>>>>>> >>>>>>> -wes >>>>>>> >>>>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>>>> frank.muller.erl@REDACTED> wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> >>>>>>>> I've an Erlang application called tapp which was running perfectly >>>>>>>> as a service under Windows 10 "build 14393" (and earlier versions). >>>>>>>> >>>>>>>> >>>>>>>> Since Microsoft is forcing updates now, the app stopped working >>>>>>>> when I got the update build "15063". >>>>>>>> >>>>>>>> Here is the syslog error message I'm getting now: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> tapp >>>>>>>> >>>>>>>> Possible cyclic restarting of erlang machine. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>>>> conhost.exe get restarted every second. >>>>>>>> >>>>>>>> >>>>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>>>> >>>>>>>> >>>>>>>> N.B: I'm using erts-8.2 >>>>>>>> >>>>>>>> >>>>>>>> /Frank >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> erlang-questions mailing list >>>>>>>> erlang-questions@REDACTED >>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>> >>>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>> >>>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.bollmann@REDACTED Tue May 9 07:17:36 2017 From: oliver.bollmann@REDACTED (Oliver Bollmann) Date: Tue, 9 May 2017 07:17:36 +0200 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Hi Frank, the problem on Windows is a bug in erlsrv, set the internal service name to display name will fix it! erlsrv add my_super_app -i my_super_app .... No delay or something else needed!! Regards, Oliver Am 09.05.17 um 06:03 schrieb Frank Muller: > Now, stopping the service takes around 30sec to finish with this > message (in System Events Viewer): > > tapp: StopAction did not terminate Erlang. Trying forced kill. > > I've defined my stop-action as: "init:stop()." > > Any idea? > > /Frank > > > wrote : > > Hi James, > > You really saved my day. After copying your exact settings, it's > working perfectly now. > > Thanks again. > > /Frank > > > wrote : > > erl 8.2 is running normally for me. I've never had restart > issues like you mentioned for any erl realease back to at > least otp 17.x. > > -wes > > On Mon, May 8, 2017 at 1:35 PM, Frank Muller > > wrote: > > Same problem even after setting Delayed-Start. > James, can you please test with erl-8.2 ? > > /Frank > > > wrote : > > The only params you can set via erlsrv, are on this > page http://erlang.org/doc/man/erlsrv.html . I don't > think you can manipulate the automatic delay or delay > time with erlsrv. Maybe something they could add > later. I've test this with otp 19.3 (8.3) and opt 20 > rc1 (9.0) and they both work. > > -wes > > > > > On Mon, May 8, 2017 at 10:13 AM, Frank Muller > > wrote: > > Hi James, > > Thank you. I'll try in few minutes and I'll let > you know. > > Question: is there a way to set these parameters > via erlsrv.exe? > > /Frank > > > > wrote : > > I just finished installing the 15063 update > and the app I had installed via erlsrv is > still running fine. With windows 10, in the > first place, to get an erl app running as a > service, i've had to set the service as > Automatic (delayed start), but to speed that > up I added the registry entry AutoStartDelay > with decimal 1 value (1 second). You can see > the script I use here: > https://github.com/comptekki/esysman . It's > the win-erlsrv-installer.cmd script. > > -wes > > On Mon, May 8, 2017 at 8:44 AM, Wes James > > wrote: > > I'm installing it now to see how it works > with my erl service. If you need your > application working, you can select the > option to go back to previous build of > windows 10. And wait until the new > windows build gets out of alpha.... > hmmm... w10 hasn't gotten out of alpha in > the first place, so...... > > -wes > > On Sun, May 7, 2017 at 11:11 PM, Frank > Muller > wrote: > > Hi, > > > I've an Erlang application called tapp > which was running perfectly as a > service under Windows 10 "build 14393" > (and earlier versions). > > > Since Microsoft is forcing updates > now, the app stopped working when I > got the update build "15063". > > Here is the syslog error message I'm > getting now: > > > > tapp > > Possible cyclic restarting of > erlang machine. > > In the Windows's task manager, I can > see that both erl.exeand > conhost.exe get restarted every second. > > > Does anyone notice this problem? Any > idea for a fix? > > > N.B: I'm using erts-8.2 > > > /Frank > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Gr??e Oliver Bollmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgud@REDACTED Tue May 9 08:18:09 2017 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 09 May 2017 06:18:09 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: A patch in PR would be really nice, and the clock is ticking for Erl-20. /Dan On Tue, May 9, 2017 at 7:17 AM Oliver Bollmann wrote: > Hi Frank, > > the problem on Windows is a bug in erlsrv, > > set the internal service name to display name will fix it! > > erlsrv add my_super_app -i my_super_app .... > > No delay or something else needed!! > > Regards, > > Oliver > > Am 09.05.17 um 06:03 schrieb Frank Muller: > > Now, stopping the service takes around 30sec to finish with this message > (in System Events Viewer): > > tapp: StopAction did not terminate Erlang. Trying forced kill. > > I've defined my stop-action as: "init:stop()." > > Any idea? > > /Frank > > wrote : > >> Hi James, >> >> You really saved my day. After copying your exact settings, it's working >> perfectly now. >> >> Thanks again. >> >> /Frank >> >> wrote : >> >> erl 8.2 is running normally for me. I've never had restart issues like >>> you mentioned for any erl realease back to at least otp 17.x. >>> >>> -wes >>> >>> On Mon, May 8, 2017 at 1:35 PM, Frank Muller >> > wrote: >>> >>>> Same problem even after setting Delayed-Start. >>>> James, can you please test with erl-8.2 ? >>>> >>>> /Frank >>>> >>>> wrote : >>>> >>>> The only params you can set via erlsrv, are on this page >>>>> http://erlang.org/doc/man/erlsrv.html . I don't think you can >>>>> manipulate the automatic delay or delay time with erlsrv. Maybe something >>>>> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >>>>> (9.0) and they both work. >>>>> >>>>> -wes >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, May 8, 2017 at 10:13 AM, Frank Muller < >>>>> frank.muller.erl@REDACTED> wrote: >>>>> >>>>>> Hi James, >>>>>> >>>>>> Thank you. I'll try in few minutes and I'll let you know. >>>>>> >>>>>> Question: is there a way to set these parameters via erlsrv.exe? >>>>>> >>>>>> /Frank >>>>>> >>>>>> wrote : >>>>>> >>>>>> I just finished installing the 15063 update and the app I had >>>>>>> installed via erlsrv is still running fine. With windows 10, in the first >>>>>>> place, to get an erl app running as a service, i've had to set the service >>>>>>> as Automatic (delayed start), but to speed that up I added the registry >>>>>>> entry AutoStartDelay with decimal 1 value (1 second). You can see the >>>>>>> script I use here: https://github.com/comptekki/esysman . It's >>>>>>> the win-erlsrv-installer.cmd script. >>>>>>> >>>>>>> -wes >>>>>>> >>>>>>> On Mon, May 8, 2017 at 8:44 AM, Wes James >>>>>>> wrote: >>>>>>> >>>>>>>> I'm installing it now to see how it works with my erl service. If >>>>>>>> you need your application working, you can select the option to go back to >>>>>>>> previous build of windows 10. And wait until the new windows build gets >>>>>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>>>>> place, so...... >>>>>>>> >>>>>>>> -wes >>>>>>>> >>>>>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>>>>> frank.muller.erl@REDACTED> wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> >>>>>>>>> I've an Erlang application called tapp which was running >>>>>>>>> perfectly as a service under Windows 10 "build 14393" (and earlier >>>>>>>>> versions). >>>>>>>>> >>>>>>>>> >>>>>>>>> Since Microsoft is forcing updates now, the app stopped working >>>>>>>>> when I got the update build "15063". >>>>>>>>> >>>>>>>>> Here is the syslog error message I'm getting now: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> tapp >>>>>>>>> >>>>>>>>> Possible cyclic restarting of erlang machine. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>>>>> conhost.exe get restarted every second. >>>>>>>>> >>>>>>>>> >>>>>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>>>>> >>>>>>>>> >>>>>>>>> N.B: I'm using erts-8.2 >>>>>>>>> >>>>>>>>> >>>>>>>>> /Frank >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>> >>>>> >>> > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > -- > Gr??e > Oliver Bollmann > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Tue May 9 11:16:32 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Tue, 09 May 2017 09:16:32 +0000 Subject: [erlang-questions] Windows Update 15063 et erl.exe In-Reply-To: References: Message-ID: Hi Oliver, Thanks for the tip. Now starting the service is fine. Can someone please explain me how the "-stopaction" is called? Does it needs a "cookie" to be properly set? In other words, how erlsrv.exe can connect to the nods and apply the "-stopaction" without a cookie? /Frank wrote : > Hi Frank, > > the problem on Windows is a bug in erlsrv, > > set the internal service name to display name will fix it! > > erlsrv add my_super_app -i my_super_app .... > > No delay or something else needed!! > > Regards, > > Oliver > > Am 09.05.17 um 06:03 schrieb Frank Muller: > > Now, stopping the service takes around 30sec to finish with this message > (in System Events Viewer): > > tapp: StopAction did not terminate Erlang. Trying forced kill. > > I've defined my stop-action as: "init:stop()." > > Any idea? > > /Frank > > wrote : > >> Hi James, >> >> You really saved my day. After copying your exact settings, it's working >> perfectly now. >> >> Thanks again. >> >> /Frank >> >> wrote : >> >> erl 8.2 is running normally for me. I've never had restart issues like >>> you mentioned for any erl realease back to at least otp 17.x. >>> >>> -wes >>> >>> On Mon, May 8, 2017 at 1:35 PM, Frank Muller >> > wrote: >>> >>>> Same problem even after setting Delayed-Start. >>>> James, can you please test with erl-8.2 ? >>>> >>>> /Frank >>>> >>>> wrote : >>>> >>>> The only params you can set via erlsrv, are on this page >>>>> http://erlang.org/doc/man/erlsrv.html . I don't think you can >>>>> manipulate the automatic delay or delay time with erlsrv. Maybe something >>>>> they could add later. I've test this with otp 19.3 (8.3) and opt 20 rc1 >>>>> (9.0) and they both work. >>>>> >>>>> -wes >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, May 8, 2017 at 10:13 AM, Frank Muller < >>>>> frank.muller.erl@REDACTED> wrote: >>>>> >>>>>> Hi James, >>>>>> >>>>>> Thank you. I'll try in few minutes and I'll let you know. >>>>>> >>>>>> Question: is there a way to set these parameters via erlsrv.exe? >>>>>> >>>>>> /Frank >>>>>> >>>>>> wrote : >>>>>> >>>>>> I just finished installing the 15063 update and the app I had >>>>>>> installed via erlsrv is still running fine. With windows 10, in the first >>>>>>> place, to get an erl app running as a service, i've had to set the service >>>>>>> as Automatic (delayed start), but to speed that up I added the registry >>>>>>> entry AutoStartDelay with decimal 1 value (1 second). You can see the >>>>>>> script I use here: https://github.com/comptekki/esysman . It's >>>>>>> the win-erlsrv-installer.cmd script. >>>>>>> >>>>>>> -wes >>>>>>> >>>>>>> On Mon, May 8, 2017 at 8:44 AM, Wes James >>>>>>> wrote: >>>>>>> >>>>>>>> I'm installing it now to see how it works with my erl service. If >>>>>>>> you need your application working, you can select the option to go back to >>>>>>>> previous build of windows 10. And wait until the new windows build gets >>>>>>>> out of alpha.... hmmm... w10 hasn't gotten out of alpha in the first >>>>>>>> place, so...... >>>>>>>> >>>>>>>> -wes >>>>>>>> >>>>>>>> On Sun, May 7, 2017 at 11:11 PM, Frank Muller < >>>>>>>> frank.muller.erl@REDACTED> wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> >>>>>>>>> I've an Erlang application called tapp which was running >>>>>>>>> perfectly as a service under Windows 10 "build 14393" (and earlier >>>>>>>>> versions). >>>>>>>>> >>>>>>>>> >>>>>>>>> Since Microsoft is forcing updates now, the app stopped working >>>>>>>>> when I got the update build "15063". >>>>>>>>> >>>>>>>>> Here is the syslog error message I'm getting now: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> tapp >>>>>>>>> >>>>>>>>> Possible cyclic restarting of erlang machine. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> In the Windows's task manager, I can see that both erl.exe and >>>>>>>>> conhost.exe get restarted every second. >>>>>>>>> >>>>>>>>> >>>>>>>>> Does anyone notice this problem? Any idea for a fix? >>>>>>>>> >>>>>>>>> >>>>>>>>> N.B: I'm using erts-8.2 >>>>>>>>> >>>>>>>>> >>>>>>>>> /Frank >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>> >>>>> >>> > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > -- > Gr??e > Oliver Bollmann > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Tue May 9 11:18:49 2017 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Tue, 9 May 2017 11:18:49 +0200 Subject: [erlang-questions] This clause cannot match because.... In-Reply-To: References: Message-ID: I had to dig a bit to see what happens. The report in this case (the second example) is generated by the pattern matching compilation in the v3_kernel.erl module, and it only does so when it happens to see that a branch will never be taken. It doesn't try more systematically to figure out which clauses would be covered by earlier ones. (There are some other cases where the compiler can detect earlier that clauses are not reachable, when the input is known or partly known, but this is not such a case.) When the pattern matching compilation comes to the point where it knows it has either ...B] or ...b], it checks whether there is a [] (empty list) after the position of B, and in that case it matches B and is happy. Otherwise it goes on to look at whether it has a 'b', and in that case whether that 'b' is followed by the empty list. But it forgets that it has checked for [] in that position already, and no warning is generated. /Richard 2017-05-08 14:54 GMT+02:00 Stefan Hellkvist : > Hi all, > > I was just struck by a bug in my code due to wrong ordering of clauses. > Given a function f/1 which could be simplified to something like this: > > f([a, B]) -> > B; > f([a, b]) -> > will_never_happen. > > The problem is that the clause f([a, b]) is never taken simply because it > is fully covered by the first clause which matches all values for the > second element in the list. If I had put the second clause before the more > general clause it would have worked the way I thought it should. > > I'm curious though. Why did the compiler not spot the problem in the code > for f/1 when it can obviously spot the problem in a, to me at least, > similar function f/2 seen below?: > > f(a, B) -> > B; > f(a, b) -> > will_never_happen. > > In this example, (f/2), I get a compilation error with a very good and > detailed description of what the problem is, but in the first case (f/1) > the compiler does not see the problem (or cannot?) with the covering > clause. > > Is this some edge case where the compiler has just stopped caring and I > must use dialyser to spot the problem at an earlier stage than at runtime? > > Stefan > > > p.s. funny thing is that if I use a tuple instead of a list to create f/1 > in the same way the compiler is once again able to spot the problem, but > not with a list as argument. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellkvist@REDACTED Tue May 9 12:44:35 2017 From: hellkvist@REDACTED (Stefan Hellkvist) Date: Tue, 9 May 2017 12:44:35 +0200 Subject: [erlang-questions] This clause cannot match because.... In-Reply-To: References: Message-ID: Thanks for the insight! To prevent myself from doing such clumsiness on clause ordering in the future, does anyone know of a tool that could give a warning also on the f/1 function (if now the pattern matching module does not do it at the moment)? /Stefan > 9 maj 2017 kl. 11:18 skrev Richard Carlsson : > > I had to dig a bit to see what happens. The report in this case (the second example) is generated by the pattern matching compilation in the v3_kernel.erl module, and it only does so when it happens to see that a branch will never be taken. It doesn't try more systematically to figure out which clauses would be covered by earlier ones. (There are some other cases where the compiler can detect earlier that clauses are not reachable, when the input is known or partly known, but this is not such a case.) > > When the pattern matching compilation comes to the point where it knows it has either ...B] or ...b], it checks whether there is a [] (empty list) after the position of B, and in that case it matches B and is happy. Otherwise it goes on to look at whether it has a 'b', and in that case whether that 'b' is followed by the empty list. But it forgets that it has checked for [] in that position already, and no warning is generated. > > > /Richard > > 2017-05-08 14:54 GMT+02:00 Stefan Hellkvist : >> Hi all, >> >> I was just struck by a bug in my code due to wrong ordering of clauses. Given a function f/1 which could be simplified to something like this: >> >> f([a, B]) -> >> B; >> f([a, b]) -> >> will_never_happen. >> >> The problem is that the clause f([a, b]) is never taken simply because it is fully covered by the first clause which matches all values for the second element in the list. If I had put the second clause before the more general clause it would have worked the way I thought it should. >> >> I'm curious though. Why did the compiler not spot the problem in the code for f/1 when it can obviously spot the problem in a, to me at least, similar function f/2 seen below?: >> >> f(a, B) -> >> B; >> f(a, b) -> >> will_never_happen. >> >> In this example, (f/2), I get a compilation error with a very good and detailed description of what the problem is, but in the first case (f/1) the compiler does not see the problem (or cannot?) with the covering clause. >> >> Is this some edge case where the compiler has just stopped caring and I must use dialyser to spot the problem at an earlier stage than at runtime? >> >> Stefan >> >> >> p.s. funny thing is that if I use a tuple instead of a list to create f/1 in the same way the compiler is once again able to spot the problem, but not with a list as argument. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.J.Thompson@REDACTED Tue May 9 20:54:40 2017 From: S.J.Thompson@REDACTED (Simon Thompson) Date: Tue, 9 May 2017 19:54:40 +0100 Subject: [erlang-questions] TFPIE - Trends in Functional Programming in Education 2017 - Deadline extended to 17 May Message-ID: <1D3E4190-0DAD-45FA-8054-A897AAE0CF46@kent.ac.uk> After a number of requests, we have extended the deadline for TFPIE 2017 to 17 May. Please consider submitting if you?re interested in hearing about how to get the functional message shared more widely. A particular topic of this year's TFPIE will be MOOCs and other online learning and, as well as a session on this, we're delighted to announce that Heather Miller of EFPL and Northeastern University will be giving a keynote on this topic. Heather works on and around the Scala programming language and is Executive Director of the Scala Center. We'll also have Yann Regis-Gianas and Benjamin Canou from the OCaml MOOC team, Jeremy Singer (Haskell), and Simon Thompson (Erlang). TFPIE 2017 - DEADLINE EXTENDED TO 17 MAY Trends in Functional Programming in Education, 2017 https://www.cs.kent.ac.uk/people/staff/sjt/TFPIE2017/ The sixth workshop on Trends in Functional Programming in Education, 2017, which is to be held on the Canterbury campus of the University of Kent on Thursday, 22 June, following the 2017 TFP meeting on 19?21 June. TFPIE workshops have previously been held in St Andrews, Scotland (2012), Provo Utah, USA (2013), Soesterberg, The Netherlands (2014), and Sophia-Antipolis, France (2015), College Park, USA (2016). The goal of TFPIE is to gather researchers, teachers and professionals that use, or are interested in the use of, functional programming in education. TFPIE aims to be a venue where novel ideas, classroom-tested ideas and work-in-progress on the use of functional programming in education are discussed. The one-day workshop will foster a spirit of open discussion by having a review process for publication after the workshop. The program chair of TFPIE 2017 will screen submissions to ensure that all presentations are within scope and are of interest to participants. After the workshop, presenters will be invited to submit revised versions of their articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Final call for papers TFPIE 2017 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science. Topics of interest include, but are not limited to: - FP and beginning CS students - FP and Computational Thinking - FP and Artificial Intelligence - FP in Robotics - FP and Music - Advanced FP for undergraduates - FP in graduate education - Engaging students in research using FP - FP in Programming Languages - FP in the high school curriculum - FP as a stepping stone to other CS topics - FP and Philosophy - The pedagogy of teaching FP - FP and e-learning: MOOCs, automated assessment etc. - Best Lectures ? more details below In addition to papers, we are requesting best lecture presentations. What?s your best lecture topic in an FP related course? Do you have a fun way to present FP concepts to novices or perhaps an especially interesting presentation of a difficult topic? In either case, please consider sharing it. Best lecture topics will be selected for presentation based on a short abstract describing the lecture and its interest to TFPIE attendees. Submission Potential presenters are invited to submit an extended abstract (4-6 pages) or a draft paper (up to 16 pages) in EPTCS style. The authors of accepted presentations will have their preprints and their slides made available on the workshop's website. Papers and abstracts can be submitted via easychair at the following link: https://easychair.org/conferences/?conf=tfpie2017 After the workshop, presenters will be invited to submit (a revised version of) their article for review. The PC will select the best articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Articles rejected for presentation and extended abstracts will not be formally reviewed by the PC. Programme committee Dr Laura Castro, University of A Coru?a Prof Ralf L?mmel, University of Koblenz-Landau Dr Elena Machkasova, University of Minnesota, Morris Prof Michel Mauny, Inria, Paris Dr Jeremy Singer, University of Glasgow Prof Simon Thompson, University of Kent (chair) Important dates Submissions of draft papers: 17 May, 2017 Notification: 22 May, 2017 Registration: 11 June, 2017 Workshop: 22 June 2017 Submission for formal review: 18 August, 2017 Notification of acceptance: 6 October, 2017 Camera ready paper: 3 November, 2017 Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From vladdu55@REDACTED Tue May 9 22:00:38 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 9 May 2017 22:00:38 +0200 Subject: [erlang-questions] ets+dets Message-ID: Hi all, I need to implement a simple key-value store that should be persistent (on disk) but have a fast in-memory cache for the recently used entries (possibly with a configurable policy) and with little concurrent access. I was thinking of an ets+dets combo, but it may be tricky to get the details right. Is there something like this out there? Would it be better to just use mnesia? I'd like to keep it lean, but if third-party databases fit the bill, I will look at them. best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Wed May 10 01:35:13 2017 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Tue, 9 May 2017 19:35:13 -0400 Subject: [erlang-questions] ets+dets In-Reply-To: References: Message-ID: Hi Vlad, My understanding is that dets lookups do involve disk-lookup latencies. But maybe ETSHandler will provide the functionality you need. https://github.com/zsoci/ETSHandler All the best, Lloyd Sent from my iPad > On May 9, 2017, at 4:00 PM, Vlad Dumitrescu wrote: > > Hi all, > > I need to implement a simple key-value store that should be persistent (on disk) but have a fast in-memory cache for the recently used entries (possibly with a configurable policy) and with little concurrent access. I was thinking of an ets+dets combo, but it may be tricky to get the details right. Is there something like this out there? Would it be better to just use mnesia? I'd like to keep it lean, but if third-party databases fit the bill, I will look at them. > > best regards, > Vlad > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vladdu55@REDACTED Wed May 10 10:21:09 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 10 May 2017 10:21:09 +0200 Subject: [erlang-questions] ets+dets In-Reply-To: References: Message-ID: Hi Lloyd, That is an interesting tool, I might be able to divert it from its original usage. Thanks! regards, Vlad On Wed, May 10, 2017 at 1:35 AM, Lloyd R. Prentice wrote: > Hi Vlad, > > My understanding is that dets lookups do involve disk-lookup latencies. > But maybe ETSHandler will provide the functionality you need. > > https://github.com/zsoci/ETSHandler > > All the best, > > Lloyd > > Sent from my iPad > > > On May 9, 2017, at 4:00 PM, Vlad Dumitrescu wrote: > > > > Hi all, > > > > I need to implement a simple key-value store that should be persistent > (on disk) but have a fast in-memory cache for the recently used entries > (possibly with a configurable policy) and with little concurrent access. I > was thinking of an ets+dets combo, but it may be tricky to get the details > right. Is there something like this out there? Would it be better to just > use mnesia? I'd like to keep it lean, but if third-party databases fit the > bill, I will look at them. > > > > best regards, > > Vlad > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Wed May 10 12:41:18 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 10 May 2017 16:11:18 +0530 (IST) Subject: [erlang-questions] Binary to string conversion Message-ID: <1933595173.48111.1494412878964@webmail.blacklightsw.com> I have set up a chat application using ejabberd(built using erlang) and Pidgin. I have witnessed a proceeding where when I print out a message sent by the client to server on ejabberd it comes out as string For example,if I send a message as aman from the pidgin and print it inside the module containing ejabberd hook as CustomMod.erl using > > Bin=xmpp:get_text(Packet#message.body), > Name=binary_to_list(Bin), > > ?INFO_MSG("The value of Name is ~p~n",[Name]), > the output comes as "aman" but I have a simple erlang module also for login as login.erl and it does not implement any ejabberd behavior, but is called from within CustomMod.erl when I print this message out in this module it comes enclosed within these << >> but are separated by 0's like aman becomes here as <<97,0,109,0,97,0,110,0>> which on doing binary_to_list(Variable) inside my login.erl I get-> [97,0,109,0,97,0,110,0] (where Variable is the value enclosed within <<>>) Can anyone tell me why is it happening and what is the way to get the value aman in login.erl also? Regards, Abhishek -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugo@REDACTED Wed May 10 13:07:13 2017 From: hugo@REDACTED (Hugo Mills) Date: Wed, 10 May 2017 11:07:13 +0000 Subject: [erlang-questions] Binary to string conversion In-Reply-To: <1933595173.48111.1494412878964@webmail.blacklightsw.com> References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> Message-ID: <20170510110713.GJ9701@carfax.org.uk> On Wed, May 10, 2017 at 04:11:18PM +0530, Abhishek Ranjan wrote: > I have set up a chat application using ejabberd(built using erlang) and Pidgin. > > I have witnessed a proceeding where when I print out a message sent by the client to server on ejabberd it comes out as string > > For example,if I send a message as > > aman > > from the pidgin and print it inside the module containing ejabberd hook as CustomMod.erl using > > > > > Bin=xmpp:get_text(Packet#message.body), > > Name=binary_to_list(Bin), > > > > ?INFO_MSG("The value of Name is ~p~n",[Name]), > > > > the output comes as "aman" > > but I have a simple erlang module also for login as login.erl and it does not implement any ejabberd behavior, but is called from within CustomMod.erl when I print this message out in this module it comes enclosed within these << >> but are separated by 0's like > > aman becomes here as <<97,0,109,0,97,0,110,0>> That looks like little-endian UTF-16 to me. You probably need to do some Unicode conversion on your binary. Hugo. > which on doing binary_to_list(Variable) inside my login.erl I get-> [97,0,109,0,97,0,110,0] > > (where Variable is the value enclosed within <<>>) > > Can anyone tell me why is it happening and what is the way to get the value aman in login.erl also? > > > Regards, > > Abhishek > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Hugo Mills | There are two hard problems in computer science: hugo@REDACTED carfax.org.uk | Cache invalidation, naming things, and off-by-one http://carfax.org.uk/ | errors. PGP: E2AB1DE4 | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From abhishek@REDACTED Wed May 10 13:36:44 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 10 May 2017 17:06:44 +0530 (IST) Subject: [erlang-questions] Binary to string conversion In-Reply-To: <20170510110713.GJ9701@carfax.org.uk> References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> <20170510110713.GJ9701@carfax.org.uk> Message-ID: <1823163098.48462.1494416204939@webmail.blacklightsw.com> I had a look at the unicode library of erlang and it contained following BIFs bin_is_7bit/1 bom_to_encoding/1 characters_to_binary/1 characters_to_binary/2 characters_to_binary/3 characters_to_binary_int/2 characters_to_list/1 characters_to_list/2 characters_to_list_int/2 encoding_to_bom/1 module_info/0 module_info/1 But what I have is already a binary and I need it to convert into string,or given the erlang's logic of storing string as a list of characters I need binary to list converter but there isn't any as it looks like to me. Please share suggestions. > On May 10, 2017 at 4:37 PM Hugo Mills wrote: > > > On Wed, May 10, 2017 at 04:11:18PM +0530, Abhishek Ranjan wrote: > > I have set up a chat application using ejabberd(built using erlang) and Pidgin. > > > > I have witnessed a proceeding where when I print out a message sent by the client to server on ejabberd it comes out as string > > > > For example,if I send a message as > > > > aman > > > > from the pidgin and print it inside the module containing ejabberd hook as CustomMod.erl using > > > > > > > > Bin=xmpp:get_text(Packet#message.body), > > > Name=binary_to_list(Bin), > > > > > > ?INFO_MSG("The value of Name is ~p~n",[Name]), > > > > > > > the output comes as "aman" > > > > but I have a simple erlang module also for login as login.erl and it does not implement any ejabberd behavior, but is called from within CustomMod.erl when I print this message out in this module it comes enclosed within these << >> but are separated by 0's like > > > > aman becomes here as <<97,0,109,0,97,0,110,0>> > > That looks like little-endian UTF-16 to me. You probably need to do > some Unicode conversion on your binary. > > Hugo. > > > which on doing binary_to_list(Variable) inside my login.erl I get-> [97,0,109,0,97,0,110,0] > > > > (where Variable is the value enclosed within <<>>) > > > > Can anyone tell me why is it happening and what is the way to get the value aman in login.erl also? > > > > > > Regards, > > > > Abhishek > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Hugo Mills | There are two hard problems in computer science: > hugo@REDACTED carfax.org.uk | Cache invalidation, naming things, and off-by-one > http://carfax.org.uk/ | errors. > PGP: E2AB1DE4 | -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Wed May 10 14:19:33 2017 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Wed, 10 May 2017 14:19:33 +0200 Subject: [erlang-questions] Binary to string conversion In-Reply-To: <1823163098.48462.1494416204939@webmail.blacklightsw.com> References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> <20170510110713.GJ9701@carfax.org.uk> <1823163098.48462.1494416204939@webmail.blacklightsw.com> Message-ID: Hello! Have you actually tried any of them? I presume this is what you need: 5> B= <<97,0,109,0,97,0,110,0>>. <<97,0,109,0,97,0,110,0>> 9> unicode:characters_to_list(B, {utf16, little}). "aman" 2017-05-10 13:36 GMT+02:00 Abhishek Ranjan : > I had a look at the unicode library of erlang and it contained following > BIFs > > bin_is_7bit/1 > bom_to_encoding/1 > characters_to_binary/1 > characters_to_binary/2 > characters_to_binary/3 > characters_to_binary_int/2 > characters_to_list/1 > characters_to_list/2 > characters_to_list_int/2 > encoding_to_bom/1 > module_info/0 > module_info/1 > > But what I have is already a binary and I need it to convert into string,or > given the erlang's logic of storing string as a list of characters I need > binary to list converter but there isn't any as it looks like to me. > > Please share suggestions. > > >> On May 10, 2017 at 4:37 PM Hugo Mills wrote: >> >> >> On Wed, May 10, 2017 at 04:11:18PM +0530, Abhishek Ranjan wrote: >> > I have set up a chat application using ejabberd(built using erlang) and >> > Pidgin. >> > >> > I have witnessed a proceeding where when I print out a message sent by >> > the client to server on ejabberd it comes out as string >> > >> > For example,if I send a message as >> > >> > aman >> > >> > from the pidgin and print it inside the module containing ejabberd hook >> > as CustomMod.erl using >> > >> > > >> > > Bin=xmpp:get_text(Packet#message.body), >> > > Name=binary_to_list(Bin), >> > > >> > > ?INFO_MSG("The value of Name is ~p~n",[Name]), >> > > >> > >> > the output comes as "aman" >> > >> > but I have a simple erlang module also for login as login.erl and it >> > does not implement any ejabberd behavior, but is called from within >> > CustomMod.erl when I print this message out in this module it comes enclosed >> > within these << >> but are separated by 0's like >> > >> > aman becomes here as <<97,0,109,0,97,0,110,0>> >> >> That looks like little-endian UTF-16 to me. You probably need to do >> some Unicode conversion on your binary. >> >> Hugo. >> >> > which on doing binary_to_list(Variable) inside my login.erl I get-> >> > [97,0,109,0,97,0,110,0] >> > >> > (where Variable is the value enclosed within <<>>) >> > >> > Can anyone tell me why is it happening and what is the way to get the >> > value aman in login.erl also? >> > >> > >> > Regards, >> > >> > Abhishek >> >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- >> Hugo Mills | There are two hard problems in computer science: >> hugo@REDACTED carfax.org.uk | Cache invalidation, naming things, and off-by-one >> http://carfax.org.uk/ | errors. >> PGP: E2AB1DE4 | > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From abhishek@REDACTED Wed May 10 14:37:56 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 10 May 2017 18:07:56 +0530 (IST) Subject: [erlang-questions] Binary to string conversion In-Reply-To: References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> <20170510110713.GJ9701@carfax.org.uk> <1823163098.48462.1494416204939@webmail.blacklightsw.com> Message-ID: <300362072.50104.1494419876800@webmail.blacklightsw.com> I tried bin_is_7bit/1 bom_to_encoding/1 encoding_to_bom/1 and didn't try the ones starting with characters keyword as I had this doubt regarding them that I have a binary not a character at hand already But thank you for the reply > On May 10, 2017 at 5:49 PM Attila Rajmund Nohl wrote: > > > Hello! > > Have you actually tried any of them? I presume this is what you need: > > 5> B= <<97,0,109,0,97,0,110,0>>. > <<97,0,109,0,97,0,110,0>> > 9> unicode:characters_to_list(B, {utf16, little}). > "aman" > > > 2017-05-10 13:36 GMT+02:00 Abhishek Ranjan : > > I had a look at the unicode library of erlang and it contained following > > BIFs > > > > bin_is_7bit/1 > > bom_to_encoding/1 > > characters_to_binary/1 > > characters_to_binary/2 > > characters_to_binary/3 > > characters_to_binary_int/2 > > characters_to_list/1 > > characters_to_list/2 > > characters_to_list_int/2 > > encoding_to_bom/1 > > module_info/0 > > module_info/1 > > > > But what I have is already a binary and I need it to convert into string,or > > given the erlang's logic of storing string as a list of characters I need > > binary to list converter but there isn't any as it looks like to me. > > > > Please share suggestions. > > > > > >> On May 10, 2017 at 4:37 PM Hugo Mills wrote: > >> > >> > >> On Wed, May 10, 2017 at 04:11:18PM +0530, Abhishek Ranjan wrote: > >> > I have set up a chat application using ejabberd(built using erlang) and > >> > Pidgin. > >> > > >> > I have witnessed a proceeding where when I print out a message sent by > >> > the client to server on ejabberd it comes out as string > >> > > >> > For example,if I send a message as > >> > > >> > aman > >> > > >> > from the pidgin and print it inside the module containing ejabberd hook > >> > as CustomMod.erl using > >> > > >> > > > >> > > Bin=xmpp:get_text(Packet#message.body), > >> > > Name=binary_to_list(Bin), > >> > > > >> > > ?INFO_MSG("The value of Name is ~p~n",[Name]), > >> > > > >> > > >> > the output comes as "aman" > >> > > >> > but I have a simple erlang module also for login as login.erl and it > >> > does not implement any ejabberd behavior, but is called from within > >> > CustomMod.erl when I print this message out in this module it comes enclosed > >> > within these << >> but are separated by 0's like > >> > > >> > aman becomes here as <<97,0,109,0,97,0,110,0>> > >> > >> That looks like little-endian UTF-16 to me. You probably need to do > >> some Unicode conversion on your binary. > >> > >> Hugo. > >> > >> > which on doing binary_to_list(Variable) inside my login.erl I get-> > >> > [97,0,109,0,97,0,110,0] > >> > > >> > (where Variable is the value enclosed within <<>>) > >> > > >> > Can anyone tell me why is it happening and what is the way to get the > >> > value aman in login.erl also? > >> > > >> > > >> > Regards, > >> > > >> > Abhishek > >> > >> > _______________________________________________ > >> > erlang-questions mailing list > >> > erlang-questions@REDACTED > >> > http://erlang.org/mailman/listinfo/erlang-questions > >> > >> > >> -- > >> Hugo Mills | There are two hard problems in computer science: > >> hugo@REDACTED carfax.org.uk | Cache invalidation, naming things, and off-by-one > >> http://carfax.org.uk/ | errors. > >> PGP: E2AB1DE4 | > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Wed May 10 15:26:24 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 10 May 2017 15:26:24 +0200 Subject: [erlang-questions] Binary to string conversion In-Reply-To: <300362072.50104.1494419876800@webmail.blacklightsw.com> References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> <20170510110713.GJ9701@carfax.org.uk> <1823163098.48462.1494416204939@webmail.blacklightsw.com> <300362072.50104.1494419876800@webmail.blacklightsw.com> Message-ID: <20170510132624.GA49139@erix.ericsson.se> On Wed, May 10, 2017 at 06:07:56PM +0530, Abhishek Ranjan wrote: > I tried > > bin_is_7bit/1 > bom_to_encoding/1 > encoding_to_bom/1 > > and didn't try the ones starting with characters keyword as I had this doubt regarding them > that I have a binary not a character at hand already Read the documentation: http://erlang.org/doc/man/unicode.html http://erlang.org/doc/man/unicode.html#characters_to_list-1 It actually explains things... > > But thank you for the reply > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From abhishek@REDACTED Wed May 10 15:34:22 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Wed, 10 May 2017 19:04:22 +0530 (IST) Subject: [erlang-questions] Binary to string conversion In-Reply-To: <20170510132624.GA49139@erix.ericsson.se> References: <1933595173.48111.1494412878964@webmail.blacklightsw.com> <20170510110713.GJ9701@carfax.org.uk> <1823163098.48462.1494416204939@webmail.blacklightsw.com> <300362072.50104.1494419876800@webmail.blacklightsw.com> <20170510132624.GA49139@erix.ericsson.se> Message-ID: <954850683.60009.1494423262413@webmail.blacklightsw.com> Sure, thanks . Regards, Abhishek > On May 10, 2017 at 6:56 PM Raimo Niskanen wrote: > > > On Wed, May 10, 2017 at 06:07:56PM +0530, Abhishek Ranjan wrote: > > I tried > > > > bin_is_7bit/1 > > bom_to_encoding/1 > > encoding_to_bom/1 > > > > and didn't try the ones starting with characters keyword as I had this doubt regarding them > > that I have a binary not a character at hand already > > Read the documentation: > http://erlang.org/doc/man/unicode.html > http://erlang.org/doc/man/unicode.html#characters_to_list-1 > > It actually explains things... > > > > > > But thank you for the reply > > > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From cesar.varona@REDACTED Wed May 10 16:39:42 2017 From: cesar.varona@REDACTED (=?UTF-8?Q?C=c3=a9sar_Varona?=) Date: Wed, 10 May 2017 16:39:42 +0200 Subject: [erlang-questions] gen_tcp:connect unable to resolve hostname if network interface goes up after being initially down Message-ID: Hi, using this Erlang websocket library I've come across an unpleasant situation: should the network interface be initially down upon attempting to establish a websocket connection with some server, it will keep indefinitely on failing with {error, nxdomain}, even if the network interface eventually comes up. This is the line that fails (full source here ): gen_tcp:connect(Host, Port, [binary,{active, false},{packet, 0}], 6000) When executed with my wireless interface disabled (no other connection available): iex(10)> :gen_tcp.connect(myHost, somePort, [:binary, {:active, false}, {:packet, 0}], 6000) {:error, :nxdomain} Please note that iex(11)> :inet_res.gethostbyname myHost {:error, :nxdomain} and iex(12)> :inet.getifaddrs() {:ok, [{'lo', [flags: [:up, :loopback, :running], hwaddr: [0, 0, 0, 0, 0, 0], addr: {127, 0, 0, 1}, netmask: {255, 0, 0, 0}, addr: {0, 0, 0, 0, 0, 0, 0, 1}, netmask: {65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535}]}, {'enp4s0f2', [flags: [:up, :broadcast, :running, :multicast], hwaddr: [0, 144, 245, 236, 118, 237]]}, {'wlp3s0', [flags: [:broadcast, :multicast], hwaddr: [238, 247, 218, 133, 87, 184]]}, ... being wlp3s0 my wireless network interface; now I turn on my wireless card again, so that iex(13)> :inet.getifaddrs() {:ok, [{'lo', [flags: [:up, :loopback, :running], hwaddr: [0, 0, 0, 0, 0, 0], addr: {127, 0, 0, 1}, netmask: {255, 0, 0, 0}, addr: {0, 0, 0, 0, 0, 0, 0, 1}, netmask: {65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535}]}, {'enp4s0f2', [flags: [:up, :broadcast, :running, :multicast], hwaddr: [0, 144, 245, 236, 118, 237]]}, {'wlp3s0', [flags: [:up, :broadcast, :running, :multicast], hwaddr: [96, 108, 102, 213, 237, 125], addr: {192, 168, 1, 36}, netmask: {255, 255, 255, 0}, broadaddr: {192, 168, 1, 255}, addr: {65152, 0, 0, 0, 44736, 36, 25537, 54250}, netmask: {65535, 65535, 65535, 65535, 0, 0, 0, 0}]}, ... and iex(14)> :inet_res.gethostbyname myHost {:ok, {:hostent, '[obfuscated]', [], :inet, 4, [{94, 23, 48, 116}]}} but any attempt to gen_tcp:connect again (from a newly launched proc) will keep on yielding a nxdomain error. I'm running this on a Fedora 25 box with Erlang 19 and Elixir 1.4.2. I use Erlang's out-of-the-box inet configuration: iex(4)> :inet.get_rc() [domain: 'localdomain', search: ['localdomain'], resolv_conf: '/etc/resolv.conf', hosts_file: '/etc/hosts', lookup: [:native]] Any clue as to what is happening and how could it be fixed? Is it a configuration problem or rather am I or the Jeremyoung library using gen_tcp improperly? Kind regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From krzysztof.jurewicz@REDACTED Wed May 10 18:18:02 2017 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Wed, 10 May 2017 18:18:02 +0200 Subject: [erlang-questions] Testing data with subsets using QuickCheck Message-ID: <8760h8eldx.fsf@gmail.com> Let?s say that we want to test lists:member/2 using QuickCheck/triq/PropEr. We want to ensure that: For every element and a list such that the element is member of the list, lists:member/2 returns true. Written as a QuickCheck property, this may look like: prop_member() -> ?FORALL( {List, Member}, list_with_member(), lists:member(Member, List)). The problem is that there is no list_with_member/0 generator. A few solutions are possible: ? Test all list members instead of one. prop_member() -> ?FORALL( List, list(int()), lists:all( fun (Member) -> lists:member(Member, List) end, List)). This may look like checking a bit too much in one test iteration. We can also write list_with_member/0 generator in one of the following ways: ? Choose one member randomly. list_with_member() -> ?LET( {List, Seed}, {non_empty(list(int())), {int(), int(), int()}}, begin _ = rand:seed(exs64, Seed), Index = rand:uniform(length(List)), {List, lists:nth(Index, List)} end). This doesn?t look very elegantly and raises questions about whether it will shrink gracefully. ? Insert an element into generated list. list_with_member() -> ?LET( {List, Element}, {list(int()), int()}, {[Element|List], Element}). The problem with this approach in this particular case is that an element is always inserted at the beginning of the list, so we won?t get any errors for implementations like this one: member(Element, [Element|_]) -> true; member(_, _) -> false. ? Write a custom generator. This seems to be generally discouraged. Any thoughts about which of the approaches above (or maybe yet another one) should be recommended in similar cases? Krzysztof From alex0player@REDACTED Wed May 10 20:27:12 2017 From: alex0player@REDACTED (Alex S.) Date: Wed, 10 May 2017 21:27:12 +0300 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: <8760h8eldx.fsf@gmail.com> References: <8760h8eldx.fsf@gmail.com> Message-ID: <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> Remember that you can generate a random element of the list using built-in generators. I think this would be the most natural approach. > 10 ??? 2017 ?., ? 19:18, Krzysztof Jurewicz ???????(?): > > Let?s say that we want to test lists:member/2 using QuickCheck/triq/PropEr. We want to ensure that: > > For every element and a list such that the element is member of the list, lists:member/2 returns true. > > Written as a QuickCheck property, this may look like: > > prop_member() -> > ?FORALL( > {List, Member}, > list_with_member(), > lists:member(Member, List)). > > The problem is that there is no list_with_member/0 generator. A few solutions are possible: > > ? Test all list members instead of one. > > prop_member() -> > ?FORALL( > List, > list(int()), > lists:all( > fun (Member) -> lists:member(Member, List) end, > List)). > > This may look like checking a bit too much in one test iteration. > > We can also write list_with_member/0 generator in one of the following ways: > > ? Choose one member randomly. > > list_with_member() -> > ?LET( > {List, Seed}, > {non_empty(list(int())), {int(), int(), int()}}, > begin > _ = rand:seed(exs64, Seed), > Index = rand:uniform(length(List)), > {List, lists:nth(Index, List)} > end). > > This doesn?t look very elegantly and raises questions about whether it will shrink gracefully. > > ? Insert an element into generated list. > > list_with_member() -> > ?LET( > {List, Element}, > {list(int()), int()}, > {[Element|List], Element}). > > The problem with this approach in this particular case is that an element is always inserted at the beginning of the list, so we won?t get any errors for implementations like this one: > > member(Element, [Element|_]) -> > true; > member(_, _) -> > false. > > ? Write a custom generator. > > This seems to be generally discouraged. > > Any thoughts about which of the approaches above (or maybe yet another one) should be recommended in similar cases? > > Krzysztof > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From jesper.louis.andersen@REDACTED Wed May 10 22:34:21 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 10 May 2017 20:34:21 +0000 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: <8760h8eldx.fsf@gmail.com> References: <8760h8eldx.fsf@gmail.com> Message-ID: On Wed, May 10, 2017 at 6:18 PM Krzysztof Jurewicz < krzysztof.jurewicz@REDACTED> wrote: > Let?s say that we want to test lists:member/2 using > QuickCheck/triq/PropEr. We want to ensure that: > > For every element and a list such that the element is member of the list, > lists:member/2 returns true. > > Written as a QuickCheck property, this may look like: > > prop_member() -> > ?FORALL( > {List, Member}, > list_with_member(), > lists:member(Member, List)). > > You have a couple of options: gen_naive() -> ?SUCHTHAT({L,M}, {list(nat()), nat()}, lists:member(M, L)). is a simple generator which uses ?SUCHTHAT. It just generates a list and a member and then verifies if the member is indeed a member of the list. Of course in this case, when we want to test exactly lists:member/2 this is silly, but in general that is a way to get at the game. The rule for a ?SUCHTHAT generator is to use it when you know it is fairly easy to generate something for which the suchthat is true. If the chance of generating an valid value is small, then you are just slowing down generation which means you can do fewer test cases. Another way is to be a bit smarter: gen_smarter() -> ?LET({L, M, R}, {list(nat()), nat(), list(nat())}, {L ++ [M] ++ R, M}). Generate a Left and a Right side and an element. Then append them together to form a list. This should generate any form of list, not just those where the element is at the beginning. And this should in principle make the test cover the domain space well. In this case I run a little above 80.000 tests in 10 seconds on this machine for both approaches, so it is fairly unlikely to slow you down much. But in general, it is more efficient to construct a specimen in a generator than search for it through ?SUCHTHAT. Writing your own custom generators is necessary for any real QuickCheck work. Automated generators can get you a long way, but if you know something about your problem domain, it is often possible to improve testing quite a lot by constructing test cases you know are troublesome far more often than what a typical autogenerated or derived generator can give you. For instance: when I wrote tests for the Erlang maps code, I found a lot of sibling pairs which hash to the same value in the HAMT. This meant I could test collisions on hashes all the time and this found some sign extension bugs in the runtime as a result which got fixed before the release of Erlang version 18.0. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Wed May 10 22:37:52 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 10 May 2017 20:37:52 +0000 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> References: <8760h8eldx.fsf@gmail.com> <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> Message-ID: On Wed, May 10, 2017 at 8:27 PM Alex S. wrote: > Remember that you can generate a random element of the list using built-in > generators. I think this would be the most natural approach. > > gen_alex() -> ?LET(L, non_empty(list(nat())), {L, elements(L)}). Indeed, this is also a way to do it. Generate a non-empty list of elements, then pick a random element in the list. This is quite a deal faster since you don't have to run appending all the time. 270.000 test cases in 10 seconds. -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Thu May 11 00:05:17 2017 From: z@REDACTED (Danil Zagoskin) Date: Thu, 11 May 2017 01:05:17 +0300 Subject: [erlang-questions] gen_tcp:connect unable to resolve hostname if network interface goes up after being initially down In-Reply-To: References: Message-ID: Hi! On Wed, May 10, 2017 at 5:39 PM, C?sar Varona wrote: > lookup: [:native] You are using system resolver, and problems you have are likely not related to Erlang/OTP. Try {lookup, [dns, file]} instead. Use inet_db:set_lookup([dns, file]) or create an inetrc file. -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Thu May 11 08:31:13 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 11 May 2017 08:31:13 +0200 Subject: [erlang-questions] gen_tcp:connect unable to resolve hostname if network interface goes up after being initially down In-Reply-To: References: Message-ID: <20170511063113.GA1886@erix.ericsson.se> On Thu, May 11, 2017 at 01:05:17AM +0300, Danil Zagoskin wrote: > Hi! > > On Wed, May 10, 2017 at 5:39 PM, C?sar Varona wrote: > > > lookup: [:native] > > > You are using system resolver, and problems you have are likely not related > to Erlang/OTP. > Try {lookup, [dns, file]} instead. Use inet_db:set_lookup([dns, file]) or > create an inetrc file. The system resolver has on some systems got a tendency to cache resolved hosts within the resolver library data itself, so if you restart the process(es) that calls the resolver library it will in some cases resolve (pun intended) the problem. There is an undocumented feature in the native resolver that does exactly this. Try to call inet_gethost_native:control(soft_restart) and see if it helps. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From krzysztof.jurewicz@REDACTED Thu May 11 15:15:43 2017 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Thu, 11 May 2017 15:15:43 +0200 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: References: <8760h8eldx.fsf@gmail.com> <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> Message-ID: <874lwredq8.fsf@gmail.com> Jesper Louis Andersen writes: > On Wed, May 10, 2017 at 8:27 PM Alex S. wrote: > >> Remember that you can generate a random element of the list using built-in >> generators. I think this would be the most natural approach. >> >> > gen_alex() -> > ?LET(L, non_empty(list(nat())), > {L, elements(L)}). Thank you. Somehow I haven?t noticed the existence of elements/1 generator. (Why is it named in plural)? From alex0player@REDACTED Thu May 11 15:21:42 2017 From: alex0player@REDACTED (Alex S.) Date: Thu, 11 May 2017 16:21:42 +0300 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: <874lwredq8.fsf@gmail.com> References: <8760h8eldx.fsf@gmail.com> <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> <874lwredq8.fsf@gmail.com> Message-ID: I think it?s supposed to describe the data set or something. ?Can generate from elements of L." > 11 ??? 2017 ?., ? 16:15, Krzysztof Jurewicz ???????(?): > > Jesper Louis Andersen writes: > >> On Wed, May 10, 2017 at 8:27 PM Alex S. wrote: >> >>> Remember that you can generate a random element of the list using built-in >>> generators. I think this would be the most natural approach. >>> >>> >> gen_alex() -> >> ?LET(L, non_empty(list(nat())), >> {L, elements(L)}). > > Thank you. Somehow I haven?t noticed the existence of elements/1 generator. (Why is it named in plural)? From raimo+erlang-questions@REDACTED Thu May 11 17:02:54 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 11 May 2017 17:02:54 +0200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <20170502113345.GA47815@erix.ericsson.se> References: <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> <20170502113345.GA47815@erix.ericsson.se> Message-ID: <20170511150254.GA42274@erix.ericsson.se> On Tue, May 02, 2017 at 01:33:45PM +0200, Raimo Niskanen wrote: > On Tue, May 02, 2017 at 09:44:35AM +1200, Richard A. O'Keefe wrote: > > > > > On 29/04/2017, at 12:28 AM, Raimo Niskanen wrote: > > > > > > It is difficult to reliably detect the other direction i.e in the driver > > > when you get an address from e.g getsockname(); is it an empty string or an > > > abstract address? > > > > Surely an empty string would never have been legal, > > so if the first byte is NUL and the host supports abstract > > addresses, it must be an abstract address? > > > > If the first byte is NUL and the length is larger than 0 then it must be an > abstract address. But when this comes from above (from Erlang) and since > we do not know if the host supports abstract addresses; if we give > the kernel a first byte NUL but address length longer than SUN_LEN(su), > will then we cause harm on some OS? > > I will assume not and rewrite the code, soonish... I now have a solution that looks at .sun_len if it exists, otherwise trusts the leading zero. That works on all platforms but Solaris since it has no .sun_len and when I get an address from e.g getsockname() on an unbound socket it is all 0's and the *lenght parameter from getsockname() is unaltered, so that has to be translated to 108 zeros. My code on all other platforms (OpenBSD, FreeBSD, Linux, Mac OS X) detect this as a zero length address... I need a way to fix this on Solaris! Any ideas? -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From krzysztof.jurewicz@REDACTED Thu May 11 18:53:02 2017 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Thu, 11 May 2017 18:53:02 +0200 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: References: <8760h8eldx.fsf@gmail.com> <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> <874lwredq8.fsf@gmail.com> Message-ID: <871srve3o1.fsf@gmail.com> Alex S. writes: > I think it?s supposed to describe the data set or something. ?Can generate from elements of L." Then there should be also generators named ?binaries?, ?integers?, ?lists? etc. Looks like an inconsistency to me. From anders@REDACTED Thu May 11 22:01:34 2017 From: anders@REDACTED (Anders Ramsell) Date: Thu, 11 May 2017 22:01:34 +0200 Subject: [erlang-questions] ets+dets In-Reply-To: References: Message-ID: Vlad Dumitrescu wrote: > Hi all, > > I need to implement a simple key-value store that should be persistent > (on disk) but have a fast in-memory cache for the recently used > entries (possibly with a configurable policy) and with little > concurrent access. I was thinking of an ets+dets combo, but it may be > tricky to get the details right. Is there something like this out > there? Would it be better to just use mnesia? I'd like to keep it > lean, but if third-party databases fit the bill, I will look at them. > In our system we have a few cases that "combine" ets and dets in roughly this way: - on startup the process fills the ets table with all contents of the dets table - write is done in both ets and dets - read is done from ets only Perhaps not so good if there are a lot of writes but that is not the case where we do this. /Anders From vladdu55@REDACTED Thu May 11 22:20:11 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 11 May 2017 22:20:11 +0200 Subject: [erlang-questions] ets+dets In-Reply-To: References: Message-ID: On Thu, May 11, 2017 at 10:01 PM, Anders Ramsell wrote: > Vlad Dumitrescu wrote: > >> Hi all, >> >> I need to implement a simple key-value store that should be persistent >> (on disk) but have a fast in-memory cache for the recently used entries >> (possibly with a configurable policy) and with little concurrent access. I >> was thinking of an ets+dets combo, but it may be tricky to get the details >> right. Is there something like this out there? Would it be better to just >> use mnesia? I'd like to keep it lean, but if third-party databases fit the >> bill, I will look at them. >> >> In our system we have a few cases that "combine" ets and dets in roughly > this way: > - on startup the process fills the ets table with all contents of the dets > table > - write is done in both ets and dets > - read is done from ets only > > Perhaps not so good if there are a lot of writes but that is not the case > where we do this. > Hi! That is a straight use, but the point in my case would be to be able to not keep everything in memory at the same time. A two-level cache, I think is the right concept. Thanks! best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From hq@REDACTED Thu May 11 22:32:47 2017 From: hq@REDACTED (Adam Rutkowski) Date: Thu, 11 May 2017 22:32:47 +0200 Subject: [erlang-questions] ets+dets In-Reply-To: References: Message-ID: <1494534767.1822652.973743416.0C0DB6E4@webmail.messagingengine.com> On Tue, May 9, 2017, at 22:00, Vlad Dumitrescu wrote: > I was thinking of an ets+dets combo, but it may be tricky to get the > details right. Is there something like this out there? Would it be > better to just use mnesia? Hi Vlad, Apologies if this sounds blunt, but isn't mnesia in fact an ETS+DETS combo with lots of tricky details? With DETS alone I often get the tables corrupted, erlang-history is the prime example -- `rm ~/.erlang-hist.nonode@REDACTED` is my weekly operation. What other properties are you looking for? Why _not_ mnesia in your case? Cheers /A. -------------- next part -------------- An HTML attachment was scrubbed... URL: From leonard.boyce@REDACTED Thu May 11 23:12:49 2017 From: leonard.boyce@REDACTED (Leonard B) Date: Thu, 11 May 2017 17:12:49 -0400 Subject: [erlang-questions] ets+dets In-Reply-To: <1494534767.1822652.973743416.0C0DB6E4@webmail.messagingengine.com> References: <1494534767.1822652.973743416.0C0DB6E4@webmail.messagingengine.com> Message-ID: On Thu, May 11, 2017 at 4:32 PM, Adam Rutkowski wrote: > On Tue, May 9, 2017, at 22:00, Vlad Dumitrescu wrote: > > I was thinking of an ets+dets combo, but it may be tricky to get the details > right. Is there something like this out there? Would it be better to just > use mnesia? > > > Hi Vlad, > > Apologies if this sounds blunt, but isn't mnesia in fact an ETS+DETS combo > with lots of tricky details? > > With DETS alone I often get the tables corrupted, erlang-history is the > prime example -- `rm ~/.erlang-hist.nonode@REDACTED` is my weekly operation. > > What other properties are you looking for? Why _not_ mnesia in your case? > > Cheers > > /A. > Hi Adam, It seems to be a common misconception that mnesia disc_copies behaves like this. I used to think so myself. In fact it keeps all data in memory and flushes to disc, so it does not meet Vlad's requirements for minimal in-memory cache, with disk storage. As was pointed out to me when I asked about it in '15, from the docs: "If a table is of type disc_copies at a certain node, the entire table is resident in RAM memory and on disc." Leonard > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From vladdu55@REDACTED Thu May 11 23:28:20 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 11 May 2017 23:28:20 +0200 Subject: [erlang-questions] ets+dets In-Reply-To: <1494534767.1822652.973743416.0C0DB6E4@webmail.messagingengine.com> References: <1494534767.1822652.973743416.0C0DB6E4@webmail.messagingengine.com> Message-ID: On Thu, May 11, 2017 at 10:32 PM, Adam Rutkowski wrote: > On Tue, May 9, 2017, at 22:00, Vlad Dumitrescu wrote: > > I was thinking of an ets+dets combo, but it may be tricky to get the > details right. Is there something like this out there? Would it be better > to just use mnesia? > > > Hi Vlad, > > Apologies if this sounds blunt, but isn't mnesia in fact an ETS+DETS combo > with lots of tricky details? > > With DETS alone I often get the tables corrupted, erlang-history is the > prime example -- `rm ~/.erlang-hist.nonode@REDACTED` is my weekly > operation. > > What other properties are you looking for? Why _not_ mnesia in your case? > Hi Adam, No problems. There are of course additional requirements, but the main issue with mnesia is that I would like to be able to build the data store from fragments that are precomputed inependently from each other, without needing to import them or something like that. These fragments can be dets tables or even simple files (one per entry), with the in-memory table just keeping references to them and sometimes computing and adding new ones. best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri May 12 01:26:01 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 11 May 2017 23:26:01 +0000 Subject: [erlang-questions] Testing data with subsets using QuickCheck In-Reply-To: <874lwredq8.fsf@gmail.com> References: <8760h8eldx.fsf@gmail.com> <05D427E1-DE68-4D1D-9959-FD22F3921976@gmail.com> <874lwredq8.fsf@gmail.com> Message-ID: On Thu, May 11, 2017 at 3:15 PM Krzysztof Jurewicz < krzysztof.jurewicz@REDACTED> wrote: > > Thank you. Somehow I haven?t noticed the existence of elements/1 > generator. (Why is it named in plural)? > The name goes back a long way: the original Haskell implementation used elements as well. And Hughes/Claessen's original paper does so too. I think the notion is "the elements of" but I am not sure, but the plurality might just be a historical thing that caught on. -------------- next part -------------- An HTML attachment was scrubbed... URL: From getonga@REDACTED Fri May 12 05:52:26 2017 From: getonga@REDACTED (=?utf-8?B?Z2V0b25nYQ==?=) Date: Fri, 12 May 2017 11:52:26 +0800 Subject: [erlang-questions] gen_fsm.html deletes all of the function spec in 20.0-rc1, I know the gen_fsm is deprecated, but I think the function doc should not be deleted. Message-ID: I compile the 20.0-rc1, and build the doc myself. And I learn that gen_fsm module is deprecated. When compiled the source code, an error will be occured: Warning: gen_fsm:start_link/3 is deprecated and will be removed in a future release; use gen_statem:start/3 Or something else. When I look into the doc, the gen_fsm module's all function docs are deleted, and I check the doc source, it is modified. But I think the function doc should be remaind, there are still a lot of projects using gen_fsm. When we look into doc, we can get the function meaning as before. Just like the module random. The random module is deprecated, but the function docs are not deleted, we can still refer to it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri May 12 08:39:40 2017 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 12 May 2017 08:39:40 +0200 Subject: [erlang-questions] gen_fsm.html deletes all of the function spec in 20.0-rc1, I know the gen_fsm is deprecated, but I think the function doc should not be deleted. In-Reply-To: References: Message-ID: Hi! 2017-05-12 5:52 GMT+02:00 getonga : > I compile the 20.0-rc1, and build the doc myself. And I learn that gen_fsm > module is deprecated. When compiled the source code, an error will be > occured: > Warning: gen_fsm:start_link/3 is deprecated and will be removed in a > future release; use gen_statem:start/3 > Or something else. > > When I look into the doc, the gen_fsm module's all function docs are > deleted, and I check the doc source, it is modified. > > But I think the function doc should be remaind, there are still a lot of > projects using gen_fsm. When we look into doc, we can get the function > meaning as before. > Just like the module random. The random module is deprecated, but the > function docs are not deleted, we can still refer to it. > > The docs for gen_fsm are still available at erlang.org, and will be also after 20, but not in the latest version thats all. It is really simple to migrate a gen_fsm to a gen_statem and the 20 gen_fsm man page gives an example of how. The random module is sort of semi deprecated and is not representative of how things have been deprecated before. When changing the crypto API a while back all documentation of deprecated functions where removed at the same time as the compiler started to warn. I belive we have not added the compiler warnings for random yet. Of course the code for gen_fsm will still be around for some time due to backwardscompatibilit reasons but we want to discurage all use of it. Regards Ingela Erlang/OTP team - Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.r.nilsson@REDACTED Fri May 12 10:49:57 2017 From: hans.r.nilsson@REDACTED (Hans Nilsson R) Date: Fri, 12 May 2017 10:49:57 +0200 Subject: [erlang-questions] Patch package OTP 19.3.4 released Message-ID: <48e79eb2-5a28-e846-4798-2d771445c4b6@ericsson.com> Patch Package: OTP 19.3.4 Git Tag: OTP-19.3.4 Date: 2017-05-12 Trouble Report Id: OTP-14391, OTP-14396 Seq num: seq13306 System: OTP Release: 19 Application: inets-6.3.9, ssl-8.1.3 Predecessor: OTP 19.3.3 Check out the git tag OTP-19.3.4, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- inets-6.3.9 ----------------------------------------------------- --------------------------------------------------------------------- The inets-6.3.9 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-14391 Application(s): inets Related Id(s): seq13306 The close of a chunked file reception crashed in a certain timing sequence. Full runtime dependencies of inets-6.3.9: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- ssl-8.1.3 ------------------------------------------------------- --------------------------------------------------------------------- Note! The ssl-8.1.3 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependency has to be satisfied: -- stdlib-3.2 (first satisfied in OTP 19.2) --- Fixed Bugs and Malfunctions --- OTP-14396 Application(s): ssl Remove debug printout Full runtime dependencies of ssl-8.1.3: crypto-3.3, erts-7.0, inets-5.10.7, kernel-3.0, public_key-1.2, stdlib-3.2 --------------------------------------------------------------------- --- Thanks to ------------------------------------------------------- --------------------------------------------------------------------- Joe DeVivo --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4101 bytes Desc: S/MIME Cryptographic Signature URL: From dmkolesnikov@REDACTED Fri May 12 12:52:43 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 12 May 2017 13:52:43 +0300 Subject: [erlang-questions] ssl lib failed with alert Message-ID: <18E2C716-1ECA-46BF-9C48-9AC670642C37@gmail.com> Hello, I hope Ingela and other bright people could help me to localize an issue with ssl 8.1 at Erlang/OTP 19 [erts-8.2]. The issue listed below is repeatable in shell and prod deployments. ``` ssl:start(). {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). {ok, Ssl} = ssl:connect(Tcp, [], 30000). =ERROR REPORT==== 12-May-2017::13:34:21 === SSL: hello: ssl_alert.erl:88:Fatal error: internal error ** exception error: no match of right hand side value {error,{tls_alert,"internal error"}} ``` It is not clear the root cause of SSL alert. Why the remote side decline SSL connection with ALERT 80? curl https://httpbin.org works. curl Client Hello is following ``` TLSv1.2 Record Layer: Handshake Protocol: Client Hello Content Type: Handshake (22) Version: TLS 1.0 (0x0301) Length: 224 Handshake Protocol: Client Hello Handshake Type: Client Hello (1) Length: 220 Version: TLS 1.2 (0x0303) Random Session ID Length: 0 Cipher Suites Length: 110 Cipher Suites (55 suites) Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (0xc024) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (0xc023) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) Cipher Suite: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (0xc007) Cipher Suite: TLS_ECDHE_RSA_WITH_RC4_128_SHA (0xc011) Cipher Suite: TLS_ECDH_ECDSA_WITH_RC4_128_SHA (0xc002) Cipher Suite: TLS_ECDH_RSA_WITH_RC4_128_SHA (0xc00c) Cipher Suite: TLS_RSA_WITH_RC4_128_SHA (0x0005) Cipher Suite: TLS_RSA_WITH_RC4_128_MD5 (0x0004) Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA384 (0x00af) Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA256 (0x00ae) Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA (0x008d) Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA (0x008c) Cipher Suite: TLS_PSK_WITH_RC4_128_SHA (0x008a) Cipher Suite: TLS_PSK_WITH_3DES_EDE_CBC_SHA (0x008b) Compression Methods Length: 1 Compression Methods (1 method) Extensions Length: 69 Extension: server_name Extension: elliptic_curves Extension: ec_point_formats Extension: signature_algorithms Extension: status_request Extension: signed_certificate_timestamp ``` OTP ssl lib Client Hello is following ``` TLSv1.2 Record Layer: Handshake Protocol: Client Hello Content Type: Handshake (22) Version: TLS 1.0 (0x0301) Length: 213 Handshake Protocol: Client Hello Handshake Type: Client Hello (1) Length: 209 Version: TLS 1.2 (0x0303) Random Session ID Length: 0 Cipher Suites Length: 100 Cipher Suites (50 suites) Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (0xc024) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) Cipher Suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 (0x00a3) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 (0x006a) Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (0xc023) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) Cipher Suite: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 (0x00a2) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 (0x0040) Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA (0x0038) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) Cipher Suite: TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA (0x0013) Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA (0x0032) Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) Compression Methods Length: 1 Compression Methods (1 method) Extensions Length: 68 Extension: elliptic_curves Extension: ec_point_formats ``` In case of curl the following Server Hello is send back ``` TLSv1.2 Record Layer: Handshake Protocol: Server Hello Content Type: Handshake (22) Version: TLS 1.2 (0x0303) Length: 87 Handshake Protocol: Server Hello Handshake Type: Server Hello (2) Length: 83 Version: TLS 1.2 (0x0303) Random Session ID Length: 32 Session ID: bbc2e52ca6918654931096e223825a4a173780c8d010837d... Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) Compression Method: null (0) Extensions Length: 11 Extension: ec_point_formats Extension: renegotiation_info ``` I can restrict ssl lib to work with TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 but it fails as well. ``` {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). {ok, Ssl} = ssl:connect(Tcp, [{ciphers, [{ecdhe_rsa,aes_128_gcm,null,sha256}]}], 30000). =ERROR REPORT==== 12-May-2017::13:49:28 === SSL: hello: ssl_alert.erl:88:Fatal error: internal error ** exception error: no match of right hand side value {error,{tls_alert,"internal error"}} ``` Thanks you in advanced! Best Regards, Dmitry From roger@REDACTED Fri May 12 13:10:52 2017 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 12 May 2017 12:10:52 +0100 Subject: [erlang-questions] Getting count of suites/cases from common test hook Message-ID: I'd like to display progress for my common test suites (~275 cases across ~50 suites), which means that I'd like to get hold of the count of suites and cases from inside a common test hook (which I already have). I know that CT has this information, because it prints it out (in ct_run:do_run_test/3) just before it starts running the tests. Can I get at this information? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kareemgan@REDACTED Fri May 12 13:55:53 2017 From: kareemgan@REDACTED (Kareem Hepburn) Date: Fri, 12 May 2017 06:55:53 -0500 Subject: [erlang-questions] RabbitMQ message consumption Message-ID: Is it possible with RabbitMQ to consume a message without it being deleted and be deleted manually? Because let's say I consumed a message and started to process it and half way through processing it the application fails. I want to be able to re-process that message again. Is it possible to not delete the message and delete it manually after my process has successfully completed? To avoid duplication, I plan to use a secondary database, either Redis or Memcache to store the ID of the message to ensure that it's not being processed by more than one application. Thanks! -- [image: kareemgan] Kareem Gan / Software Engineer kareemgan@REDACTED [image: Skype] [image: Facebook] [image: Twitter] [image: Google Plus] [image: Linkedin] [image: Skype] This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: From binarin@REDACTED Fri May 12 14:54:54 2017 From: binarin@REDACTED (Alexey Lebedeff) Date: Fri, 12 May 2017 15:54:54 +0300 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: Message-ID: <8737ca8cbl.fsf@binarin.ru> Hi Kareem, You don't need a secondary database. Unless you consume in a 'no-ack' mode, RabbitMQ expects an explicit 'ack' message from you for every message that it sends to you. This the message will not be sent to other consumers - unless there is an explicit reject or a connection loss. Also you should look into QoS parameter to prevent overwhelming your consumer. Best, Alexey Kareem Hepburn writes: > Is it possible with RabbitMQ to consume a message without it being deleted > and be deleted manually? > > Because let's say I consumed a message and started to process it and half > way through processing it the application fails. I want to be able to > re-process that message again. Is it possible to not delete the message and > delete it manually after my process has successfully completed? > > To avoid duplication, I plan to use a secondary database, either Redis or > Memcache to store the ID of the message to ensure that it's not being > processed by more than one application. > > Thanks! From bchamagne@REDACTED Fri May 12 14:56:57 2017 From: bchamagne@REDACTED (Bastien CHAMAGNE) Date: Fri, 12 May 2017 14:56:57 +0200 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: Message-ID: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> Hi Kareem, you should ack only when your application have processed the message. See https://www.rabbitmq.com/confirms.html On 12/05/2017 13:55, Kareem Hepburn wrote: > Is it possible with RabbitMQ to consume a message without it being > deleted and be deleted manually? > > Because let's say I consumed a message and started to process it and > half way through processing it the application fails. I want to be > able to re-process that message again. Is it possible to not delete > the message and delete it manually after my process has successfully > completed? > > To avoid duplication, I plan to use a secondary database, either Redis > or Memcache to store the ID of the message to ensure that it's not > being processed by more than one application. > > Thanks! > > -- > > kareemgan > > Kareem Gan / Software Engineer > kareemgan@REDACTED > > Skype Facebook > Twitter Google Plus > Linkedin > Skype > > This e-mail message may contain confidential or legally privileged > information and is intended only for the use of the intended > recipient(s). Any unauthorized disclosure, dissemination, > distribution, copying or the taking of any action in reliance on the > information herein is prohibited. E-mails are not secure and cannot be > guaranteed to be error free as they can be intercepted, amended, or > contain viruses. Anyone who communicates with us by e-mail is deemed > to have accepted these risks. Company Name is not responsible for > errors or omissions in this message and denies any responsibility for > any damage arising from the use of e-mail. Any opinion and other > statement contained in this message and any attachment are solely > those of the author and do not necessarily represent those of the company. > > > > _______________________________________________ > 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 May 12 15:04:04 2017 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 12 May 2017 15:04:04 +0200 Subject: [erlang-questions] ssl lib failed with alert In-Reply-To: <18E2C716-1ECA-46BF-9C48-9AC670642C37@gmail.com> References: <18E2C716-1ECA-46BF-9C48-9AC670642C37@gmail.com> Message-ID: Hi! 2017-05-12 12:52 GMT+02:00 Dmitry Kolesnikov : > Hello, > > I hope Ingela and other bright people could help me to localize an issue > with ssl 8.1 at Erlang/OTP 19 [erts-8.2]. The issue listed below is > repeatable in shell and prod deployments. > > ``` > ssl:start(). > {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). > {ok, Ssl} = ssl:connect(Tcp, [], 30000). > > =ERROR REPORT==== 12-May-2017::13:34:21 === > SSL: hello: ssl_alert.erl:88:Fatal error: internal error > ** exception error: no match of right hand side value > {error,{tls_alert,"internal error"}} > ``` > > It is not clear the root cause of SSL alert. Why the remote side decline > SSL connection with ALERT 80? curl https://httpbin.org works. > > It is the server that sends the alert 80, which means that the server experienced an internal error. The following works fine: ssl:connect("httpbin.org", 443, []). {ok,{sslsocket,{gen_tcp,#Port<0.839>,tls_connection, undefined}, <0.105.0>}} If you first want to manually start a tcp connection and then upgrade it to TLS the client and server need to somehow agree on this so that the server is ready to receive the TLS client hello when it is sent by the client. This is often referred to as STARTTLS and is used by a lot of protocols like FTPS. Regards Ingela Erlang/OTP Team Ericsson AB > curl Client Hello is following > > ``` > TLSv1.2 Record Layer: Handshake Protocol: Client Hello > Content Type: Handshake (22) > Version: TLS 1.0 (0x0301) > Length: 224 > Handshake Protocol: Client Hello > Handshake Type: Client Hello (1) > Length: 220 > Version: TLS 1.2 (0x0303) > Random > Session ID Length: 0 > Cipher Suites Length: 110 > Cipher Suites (55 suites) > Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (0xc024) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (0xc023) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) > Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) > Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) > Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) > Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) > Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) > Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) > Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) > Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) > Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) > Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) > Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (0xc007) > Cipher Suite: TLS_ECDHE_RSA_WITH_RC4_128_SHA (0xc011) > Cipher Suite: TLS_ECDH_ECDSA_WITH_RC4_128_SHA (0xc002) > Cipher Suite: TLS_ECDH_RSA_WITH_RC4_128_SHA (0xc00c) > Cipher Suite: TLS_RSA_WITH_RC4_128_SHA (0x0005) > Cipher Suite: TLS_RSA_WITH_RC4_128_MD5 (0x0004) > Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA384 (0x00af) > Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA256 (0x00ae) > Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA (0x008d) > Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA (0x008c) > Cipher Suite: TLS_PSK_WITH_RC4_128_SHA (0x008a) > Cipher Suite: TLS_PSK_WITH_3DES_EDE_CBC_SHA (0x008b) > Compression Methods Length: 1 > Compression Methods (1 method) > Extensions Length: 69 > Extension: server_name > Extension: elliptic_curves > Extension: ec_point_formats > Extension: signature_algorithms > Extension: status_request > Extension: signed_certificate_timestamp > ``` > > OTP ssl lib Client Hello is following > > ``` > TLSv1.2 Record Layer: Handshake Protocol: Client Hello > Content Type: Handshake (22) > Version: TLS 1.0 (0x0301) > Length: 213 > Handshake Protocol: Client Hello > Handshake Type: Client Hello (1) > Length: 209 > Version: TLS 1.2 (0x0303) > Random > Session ID Length: 0 > Cipher Suites Length: 100 > Cipher Suites (50 suites) > Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 (0xc024) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) > Cipher Suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 (0x00a3) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) > Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 (0x006a) > Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) > Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (0xc023) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) > Cipher Suite: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 (0x00a2) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) > Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 (0x0040) > Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) > Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) > Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) > Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA (0x0038) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) > Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) > Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) > Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) > Cipher Suite: TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA (0x0013) > Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) > Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) > Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) > Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) > Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) > Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA (0x0032) > Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) > Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) > Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) > Compression Methods Length: 1 > Compression Methods (1 method) > Extensions Length: 68 > Extension: elliptic_curves > Extension: ec_point_formats > ``` > > In case of curl the following Server Hello is send back > ``` > TLSv1.2 Record Layer: Handshake Protocol: Server Hello > Content Type: Handshake (22) > Version: TLS 1.2 (0x0303) > Length: 87 > Handshake Protocol: Server Hello > Handshake Type: Server Hello (2) > Length: 83 > Version: TLS 1.2 (0x0303) > Random > Session ID Length: 32 > Session ID: bbc2e52ca6918654931096e223825a4a173780c8d010837d... > Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) > Compression Method: null (0) > Extensions Length: 11 > Extension: ec_point_formats > Extension: renegotiation_info > ``` > > I can restrict ssl lib to work with TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 > but it fails as well. > > ``` > {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). > {ok, Ssl} = ssl:connect(Tcp, [{ciphers, [{ecdhe_rsa,aes_128_gcm,null,sha256}]}], > 30000). > > =ERROR REPORT==== 12-May-2017::13:49:28 === > SSL: hello: ssl_alert.erl:88:Fatal error: internal error > ** exception error: no match of right hand side value > {error,{tls_alert,"internal error"}} > ``` > > Thanks you in advanced! > > Best Regards, > Dmitry > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri May 12 15:05:20 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 12 May 2017 15:05:20 +0200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <20170511150254.GA42274@erix.ericsson.se> References: <20170426085558.GA87429@erix.ericsson.se> <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> <20170502113345.GA47815@erix.ericsson.se> <20170511150254.GA42274@erix.ericsson.se> Message-ID: <20170512130520.GA11366@erix.ericsson.se> On Thu, May 11, 2017 at 05:02:54PM +0200, Raimo Niskanen wrote: > On Tue, May 02, 2017 at 01:33:45PM +0200, Raimo Niskanen wrote: > > On Tue, May 02, 2017 at 09:44:35AM +1200, Richard A. O'Keefe wrote: > > > > > > > On 29/04/2017, at 12:28 AM, Raimo Niskanen wrote: > > > > > > > > It is difficult to reliably detect the other direction i.e in the driver > > > > when you get an address from e.g getsockname(); is it an empty string or an > > > > abstract address? > > > > > > Surely an empty string would never have been legal, > > > so if the first byte is NUL and the host supports abstract > > > addresses, it must be an abstract address? > > > > > > > If the first byte is NUL and the length is larger than 0 then it must be an > > abstract address. But when this comes from above (from Erlang) and since > > we do not know if the host supports abstract addresses; if we give > > the kernel a first byte NUL but address length longer than SUN_LEN(su), > > will then we cause harm on some OS? > > > > I will assume not and rewrite the code, soonish... > > I now have a solution that looks at .sun_len if it exists, otherwise trusts > the leading zero. I was wrong. .sun_len says the same as the argument size parameter so that was a dead end. > > That works on all platforms but Solaris since it has no .sun_len and when > I get an address from e.g getsockname() on an unbound socket it is all 0's > and the *lenght parameter from getsockname() is unaltered, so that has to > be translated to 108 zeros. My code on all other platforms (OpenBSD, > FreeBSD, Linux, Mac OS X) detect this as a zero length address... > > I need a way to fix this on Solaris! Now also on FreeBSD and OpenBSD... > > Any ideas? > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bchamagne@REDACTED Fri May 12 15:24:15 2017 From: bchamagne@REDACTED (Bastien CHAMAGNE) Date: Fri, 12 May 2017 15:24:15 +0200 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> Message-ID: <03a65984-0064-254e-8fa7-72709d07b5ce@idmog.com> Once a consumer reads a message, that message goes from "READY" to "UNACKED". It's not deleted that fast! As long as it's in "UNACKED" state, it will not be delivered to anyone else. Then once your consumer have finished processing the message, it must send an ACK that will remove the message from rabbitMQ. If your consumer crashes midway through, there will be no ACK and rabbitMQ knows that it can be redistributed (message is "READY" again). On 12/05/2017 15:16, Kareem Hepburn wrote: > What about reject? The thing is, if there are multiple nodes of a > worker that's consuming the message I want it that if a worker already > read the message, it will not be possible to for it to be delivered to > the other consumers so I am guessing ack will do this for me and > reject will requeue it if my process fails. > > Am I correct on this? > > On Fri, May 12, 2017 at 7:56 AM, Bastien CHAMAGNE > wrote: > > Hi Kareem, you should ack only when your application have > processed the message. See https://www.rabbitmq.com/confirms.html > > > > On 12/05/2017 13:55, Kareem Hepburn wrote: >> Is it possible with RabbitMQ to consume a message without it >> being deleted and be deleted manually? >> >> Because let's say I consumed a message and started to process it >> and half way through processing it the application fails. I want >> to be able to re-process that message again. Is it possible to >> not delete the message and delete it manually after my process >> has successfully completed? >> >> To avoid duplication, I plan to use a secondary database, either >> Redis or Memcache to store the ID of the message to ensure that >> it's not being processed by more than one application. >> >> Thanks! >> >> -- >> >> kareemgan >> >> Kareem Gan / Software Engineer >> kareemgan@REDACTED >> >> Skype Facebook >> Twitter Google >> Plus Linkedin >> Skype >> >> This e-mail message may contain confidential or legally >> privileged information and is intended only for the use of the >> intended recipient(s). Any unauthorized disclosure, >> dissemination, distribution, copying or the taking of any action >> in reliance on the information herein is prohibited. E-mails are >> not secure and cannot be guaranteed to be error free as they can >> be intercepted, amended, or contain viruses. Anyone who >> communicates with us by e-mail is deemed to have accepted these >> risks. Company Name is not responsible for errors or omissions in >> this message and denies any responsibility for any damage arising >> from the use of e-mail. Any opinion and other statement contained >> in this message and any attachment are solely those of the author >> and do not necessarily represent those of the company. >> >> >> >> _______________________________________________ >> 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 > > > -- > > kareemgan > > Kareem Gan / Software Engineer kareemgan@REDACTED > > > Skype Facebook > Twitter Google Plus > Linkedin > Skype > > This e-mail message may contain confidential or legally privileged > information and is intended only for the use of the intended > recipient(s). Any unauthorized disclosure, dissemination, > distribution, copying or the taking of any action in reliance on the > information herein is prohibited. E-mails are not secure and cannot be > guaranteed to be error free as they can be intercepted, amended, or > contain viruses. Anyone who communicates with us by e-mail is deemed > to have accepted these risks. Company Name is not responsible for > errors or omissions in this message and denies any responsibility for > any damage arising from the use of e-mail. Any opinion and other > statement contained in this message and any attachment are solely > those of the author and do not necessarily represent those of the company. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solvip@REDACTED Fri May 12 14:42:59 2017 From: solvip@REDACTED (=?UTF-8?B?U8O2bHZpIFDDoWxsIMOBc2dlaXJzc29u?=) Date: Fri, 12 May 2017 12:42:59 +0000 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: Message-ID: I think you want to use RabbitMQ's message acknowledgement. The general idea is that you: - Consume a message - Process it - Acknowledge to RabbitMQ that you've processed it, which causes it to be deleted from the queue. You can read more at https://www.rabbitmq.com/confirms.html If you're using the Erlang RabbitMQ client, you can do something like this when subscribing: #'basic.consume_ok'{} = amqp_channel:subscribe(Channel, #'basic.consume'{queue = Queue, no_ack = false}, self()), Then, when you've handled your message, you call: amqp_channel:cast(Channel, #'basic.ack'{delivery_tag = Tag}). Hope this helps Cheers S?lvi On Fri, May 12, 2017 at 11:55 AM, Kareem Hepburn wrote: > Is it possible with RabbitMQ to consume a message without it being deleted > and be deleted manually? > > Because let's say I consumed a message and started to process it and half > way through processing it the application fails. I want to be able to > re-process that message again. Is it possible to not delete the message and > delete it manually after my process has successfully completed? > > To avoid duplication, I plan to use a secondary database, either Redis or > Memcache to store the ID of the message to ensure that it's not being > processed by more than one application. > > Thanks! > > -- > > [image: kareemgan] > > Kareem Gan / Software Engineer > kareemgan@REDACTED > > [image: Skype] [image: Facebook] > [image: Twitter] [image: > Google Plus] [image: > Linkedin] [image: Skype] > > > This e-mail message may contain confidential or legally privileged > information and is intended only for the use of the intended recipient(s). > Any unauthorized disclosure, dissemination, distribution, copying or the > taking of any action in reliance on the information herein is prohibited. > E-mails are not secure and cannot be guaranteed to be error free as they > can be intercepted, amended, or contain viruses. Anyone who communicates > with us by e-mail is deemed to have accepted these risks. Company Name is > not responsible for errors or omissions in this message and denies any > responsibility for any damage arising from the use of e-mail. Any opinion > and other statement contained in this message and any attachment are solely > those of the author and do not necessarily represent those of the company. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kareemgan@REDACTED Fri May 12 14:46:41 2017 From: kareemgan@REDACTED (Kareem Hepburn) Date: Fri, 12 May 2017 07:46:41 -0500 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: Message-ID: It most certainly does! Thank you! On Fri, May 12, 2017 at 7:42 AM, S?lvi P?ll ?sgeirsson wrote: > I think you want to use RabbitMQ's message acknowledgement. > > The general idea is that you: > - Consume a message > - Process it > - Acknowledge to RabbitMQ that you've processed it, which causes it to be > deleted from the queue. > > You can read more at https://www.rabbitmq.com/confirms.html > > If you're using the Erlang RabbitMQ client, you can do something like this > when subscribing: > > #'basic.consume_ok'{} = amqp_channel:subscribe(Channel, > #'basic.consume'{queue = Queue, no_ack = false}, self()), > > Then, when you've handled your message, you call: > > amqp_channel:cast(Channel, #'basic.ack'{delivery_tag = Tag}). > > Hope this helps > > Cheers > S?lvi > > > On Fri, May 12, 2017 at 11:55 AM, Kareem Hepburn > wrote: > >> Is it possible with RabbitMQ to consume a message without it being >> deleted and be deleted manually? >> >> Because let's say I consumed a message and started to process it and half >> way through processing it the application fails. I want to be able to >> re-process that message again. Is it possible to not delete the message and >> delete it manually after my process has successfully completed? >> >> To avoid duplication, I plan to use a secondary database, either Redis or >> Memcache to store the ID of the message to ensure that it's not being >> processed by more than one application. >> >> Thanks! >> >> -- >> >> [image: kareemgan] >> >> Kareem Gan / Software Engineer >> kareemgan@REDACTED >> >> [image: Skype] [image: Facebook] >> [image: Twitter] [image: >> Google Plus] [image: >> Linkedin] [image: Skype] >> >> >> This e-mail message may contain confidential or legally privileged >> information and is intended only for the use of the intended recipient(s). >> Any unauthorized disclosure, dissemination, distribution, copying or the >> taking of any action in reliance on the information herein is prohibited. >> E-mails are not secure and cannot be guaranteed to be error free as they >> can be intercepted, amended, or contain viruses. Anyone who communicates >> with us by e-mail is deemed to have accepted these risks. Company Name is >> not responsible for errors or omissions in this message and denies any >> responsibility for any damage arising from the use of e-mail. Any opinion >> and other statement contained in this message and any attachment are solely >> those of the author and do not necessarily represent those of the company. >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- [image: kareemgan] Kareem Gan / Software Engineer kareemgan@REDACTED [image: Skype] [image: Facebook] [image: Twitter] [image: Google Plus] [image: Linkedin] [image: Skype] This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kareemgan@REDACTED Fri May 12 15:16:19 2017 From: kareemgan@REDACTED (Kareem Hepburn) Date: Fri, 12 May 2017 08:16:19 -0500 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> References: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> Message-ID: What about reject? The thing is, if there are multiple nodes of a worker that's consuming the message I want it that if a worker already read the message, it will not be possible to for it to be delivered to the other consumers so I am guessing ack will do this for me and reject will requeue it if my process fails. Am I correct on this? On Fri, May 12, 2017 at 7:56 AM, Bastien CHAMAGNE wrote: > Hi Kareem, you should ack only when your application have processed the > message. See https://www.rabbitmq.com/confirms.html > > > On 12/05/2017 13:55, Kareem Hepburn wrote: > > Is it possible with RabbitMQ to consume a message without it being deleted > and be deleted manually? > > Because let's say I consumed a message and started to process it and half > way through processing it the application fails. I want to be able to > re-process that message again. Is it possible to not delete the message and > delete it manually after my process has successfully completed? > > To avoid duplication, I plan to use a secondary database, either Redis or > Memcache to store the ID of the message to ensure that it's not being > processed by more than one application. > > Thanks! > > -- > > [image: kareemgan] > > Kareem Gan / Software Engineer > kareemgan@REDACTED > > [image: Skype] [image: Facebook] > [image: Twitter] [image: > Google Plus] [image: > Linkedin] [image: Skype] > > > This e-mail message may contain confidential or legally privileged > information and is intended only for the use of the intended recipient(s). > Any unauthorized disclosure, dissemination, distribution, copying or the > taking of any action in reliance on the information herein is prohibited. > E-mails are not secure and cannot be guaranteed to be error free as they > can be intercepted, amended, or contain viruses. Anyone who communicates > with us by e-mail is deemed to have accepted these risks. Company Name is > not responsible for errors or omissions in this message and denies any > responsibility for any damage arising from the use of e-mail. Any opinion > and other statement contained in this message and any attachment are solely > those of the author and do not necessarily represent those of the company. > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- [image: kareemgan] Kareem Gan / Software Engineer kareemgan@REDACTED [image: Skype] [image: Facebook] [image: Twitter] [image: Google Plus] [image: Linkedin] [image: Skype] This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kareemgan@REDACTED Fri May 12 15:31:53 2017 From: kareemgan@REDACTED (Kareem Hepburn) Date: Fri, 12 May 2017 08:31:53 -0500 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: <03a65984-0064-254e-8fa7-72709d07b5ce@idmog.com> References: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> <03a65984-0064-254e-8fa7-72709d07b5ce@idmog.com> Message-ID: Gotcha. Thanks! I was using Reject earlier but I guess Ack is sufficient to what I need to do. On Fri, May 12, 2017 at 8:24 AM, Bastien CHAMAGNE wrote: > Once a consumer reads a message, that message goes from "READY" to > "UNACKED". It's not deleted that fast! As long as it's in "UNACKED" state, > it will not be delivered to anyone else. Then once your consumer have > finished processing the message, it must send an ACK that will remove the > message from rabbitMQ. If your consumer crashes midway through, there will > be no ACK and rabbitMQ knows that it can be redistributed (message is > "READY" again). > > On 12/05/2017 15:16, Kareem Hepburn wrote: > > What about reject? The thing is, if there are multiple nodes of a worker > that's consuming the message I want it that if a worker already read the > message, it will not be possible to for it to be delivered to the other > consumers so I am guessing ack will do this for me and reject will requeue > it if my process fails. > > Am I correct on this? > > On Fri, May 12, 2017 at 7:56 AM, Bastien CHAMAGNE > wrote: > >> Hi Kareem, you should ack only when your application have processed the >> message. See https://www.rabbitmq.com/confirms.html >> >> >> On 12/05/2017 13:55, Kareem Hepburn wrote: >> >> Is it possible with RabbitMQ to consume a message without it being >> deleted and be deleted manually? >> >> Because let's say I consumed a message and started to process it and half >> way through processing it the application fails. I want to be able to >> re-process that message again. Is it possible to not delete the message and >> delete it manually after my process has successfully completed? >> >> To avoid duplication, I plan to use a secondary database, either Redis or >> Memcache to store the ID of the message to ensure that it's not being >> processed by more than one application. >> >> Thanks! >> >> -- >> >> [image: kareemgan] >> >> Kareem Gan / Software Engineer >> kareemgan@REDACTED >> >> [image: Skype] [image: Facebook] >> [image: Twitter] [image: >> Google Plus] [image: >> Linkedin] [image: Skype] >> >> >> This e-mail message may contain confidential or legally privileged >> information and is intended only for the use of the intended recipient(s). >> Any unauthorized disclosure, dissemination, distribution, copying or the >> taking of any action in reliance on the information herein is prohibited. >> E-mails are not secure and cannot be guaranteed to be error free as they >> can be intercepted, amended, or contain viruses. Anyone who communicates >> with us by e-mail is deemed to have accepted these risks. Company Name is >> not responsible for errors or omissions in this message and denies any >> responsibility for any damage arising from the use of e-mail. Any opinion >> and other statement contained in this message and any attachment are solely >> those of the author and do not necessarily represent those of the company. >> >> >> _______________________________________________ >> erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ erlang-questions mailing >> list erlang-questions@REDACTED http://erlang.org/mailman/list >> info/erlang-questions > > -- > > [image: kareemgan] > > Kareem Gan / Software Engineer kareemgan@REDACTED > > [image: Skype] [image: Facebook] > [image: Twitter] [image: > Google Plus] [image: > Linkedin] [image: Skype] > > > This e-mail message may contain confidential or legally privileged > information and is intended only for the use of the intended recipient(s). > Any unauthorized disclosure, dissemination, distribution, copying or the > taking of any action in reliance on the information herein is prohibited. > E-mails are not secure and cannot be guaranteed to be error free as they > can be intercepted, amended, or contain viruses. Anyone who communicates > with us by e-mail is deemed to have accepted these risks. Company Name is > not responsible for errors or omissions in this message and denies any > responsibility for any damage arising from the use of e-mail. Any opinion > and other statement contained in this message and any attachment are solely > those of the author and do not necessarily represent those of the company. > > -- [image: kareemgan] Kareem Gan / Software Engineer kareemgan@REDACTED [image: Skype] [image: Facebook] [image: Twitter] [image: Google Plus] [image: Linkedin] [image: Skype] This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Fri May 12 15:54:28 2017 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Fri, 12 May 2017 09:54:28 -0400 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> <03a65984-0064-254e-8fa7-72709d07b5ce@idmog.com> Message-ID: If the connection drops and there are un-acked messages, Rabbit will reject them all (returning them to a "ready" state). If you set up your supervision tree such that an error while working on a message takes out the process that was talking to Rabbit, this can be convenient. If your Rabbit consumer is just handing off messages and you don't plan for it to die itself, you will need to track messages you've handed off and explicitly reject those that went to a dead consumer. > On May 12, 2017, at 9:31 AM, Kareem Hepburn wrote: > > Gotcha. Thanks! I was using Reject earlier but I guess Ack is sufficient to what I need to do. > > On Fri, May 12, 2017 at 8:24 AM, Bastien CHAMAGNE > wrote: > Once a consumer reads a message, that message goes from "READY" to "UNACKED". It's not deleted that fast! As long as it's in "UNACKED" state, it will not be delivered to anyone else. Then once your consumer have finished processing the message, it must send an ACK that will remove the message from rabbitMQ. If your consumer crashes midway through, there will be no ACK and rabbitMQ knows that it can be redistributed (message is "READY" again). > > On 12/05/2017 15:16, Kareem Hepburn wrote: >> What about reject? The thing is, if there are multiple nodes of a worker that's consuming the message I want it that if a worker already read the message, it will not be possible to for it to be delivered to the other consumers so I am guessing ack will do this for me and reject will requeue it if my process fails. >> >> Am I correct on this? >> >> On Fri, May 12, 2017 at 7:56 AM, Bastien CHAMAGNE > wrote: >> Hi Kareem, you should ack only when your application have processed the message. See https://www.rabbitmq.com/confirms.html >> >> On 12/05/2017 13:55, Kareem Hepburn wrote: >>> Is it possible with RabbitMQ to consume a message without it being deleted and be deleted manually? >>> >>> Because let's say I consumed a message and started to process it and half way through processing it the application fails. I want to be able to re-process that message again. Is it possible to not delete the message and delete it manually after my process has successfully completed? >>> >>> To avoid duplication, I plan to use a secondary database, either Redis or Memcache to store the ID of the message to ensure that it's not being processed by more than one application. >>> >>> Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri May 12 16:22:07 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 12 May 2017 17:22:07 +0300 Subject: [erlang-questions] Getting count of suites/cases from common test hook In-Reply-To: References: Message-ID: You want to get number of test suites _before_ launching tests? -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Fri May 12 16:31:02 2017 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 12 May 2017 15:31:02 +0100 Subject: [erlang-questions] Getting count of suites/cases from common test hook In-Reply-To: References: Message-ID: On 12 May 2017 at 15:22, Max Lapshin wrote: > You want to get number of test suites _before_ launching tests? > Yes. A full test run takes about 20 minutes, so I'd like to display test progress (probably in the title bar of the terminal window). That requires knowing the number of tests suites/cases up front. CT itself can figure this out; I was wondering if there was a way to get at that information (probably in a CTH, because I already have one of those). -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri May 12 20:14:54 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 12 May 2017 21:14:54 +0300 Subject: [erlang-questions] Getting count of suites/cases from common test hook In-Reply-To: References: Message-ID: It requires calling functions in each module. As far as I remember, ct_hook don't tell it before. It is easy to add handler: ct_run ... -event_handler flussonic_ct_handler in the handler you get: -module(flussonic_ct_handler). -record(event, {name, node, data}). % http://erlang.org/doc/apps/common_test/event_handler_chapter.html -compile(export_all). init(_Args) -> % io:fwrite(standard_error, "ARGS: ~p\n\n", [Args]), {ok, #state{started_at = now_ms()}}. handle_event(#event{name=start_make}, #state{first_make_at = undefined} =State) -> {ok, State#state{first_make_at = now_ms()}}; ..... But I don't remember there a total count of tests _before_ launching. However, the progress bar is a cool idea. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Fri May 12 21:24:32 2017 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 12 May 2017 20:24:32 +0100 Subject: [erlang-questions] Getting count of suites/cases from common test hook In-Reply-To: References: Message-ID: On 12 May 2017 at 19:14, Max Lapshin wrote: > ct_run ... -event_handler flussonic_ct_handler > Thanks, Max. There are event hooks for all of the things I'm interested in. This is perfect. Except... I'll raise another question for the follow-up. Cheers, Roger. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Fri May 12 21:28:39 2017 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 12 May 2017 20:28:39 +0100 Subject: [erlang-questions] Can't update xterm title bar from Erlang Message-ID: I have the following: put_progress(Format, Args) -> io:put_chars(user, [tsl(), io_lib:format(Format, Args), fsl()]), io:put_chars(user, [colored(), io_lib:format(Format, Args), reset(), "\n"]), ok. tsl() -> "\e]0;". fsl() -> "\a". colored() -> "\e[1;44m". reset() -> "\e[0m". That is: output the same message to the title bar (tsl, fsl are the tput capability names; see https://serverfault.com/a/23998/7027), and then (for now) also output it in colour, so that I can see if it's being called correctly. Unfortunately, something is messing with my tsl() and fsl() escape codes. The coloured text is coming out correctly, but the other stuff's garbage. The escape codes are correct; I've tested them at the bash prompt with "echo -e '\e]0;Hello\a'". So... what's screwing with them when they're output from ct_run? Interestingly, if I try the same at the Erlang prompt, it hangs the shell until I press Ctrl+C twice, at which point the text is output, but still messed up. Cheers, Roger. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Fri May 12 23:15:19 2017 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 12 May 2017 23:15:19 +0200 Subject: [erlang-questions] ssl lib failed with alert In-Reply-To: References: <18E2C716-1ECA-46BF-9C48-9AC670642C37@gmail.com> Message-ID: Hi again! On second thought, you did connect to an TLS server not to a upgradeable tcp server as I was thinking about. So your approach should work as it is was ssl internally does. Your site does seem to require a server name indication though, which you will get with ssl:connect . {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). {ok, Ssl} = ssl:connect(Tcp, [{server_name_indication,"httpbin.org"}], 30000). works. Regards Ingela Erlang/OTP team - Ericsson AB 2017-05-12 15:04 GMT+02:00 Ingela Andin : > Hi! > > 2017-05-12 12:52 GMT+02:00 Dmitry Kolesnikov : > >> Hello, >> >> I hope Ingela and other bright people could help me to localize an issue >> with ssl 8.1 at Erlang/OTP 19 [erts-8.2]. The issue listed below is >> repeatable in shell and prod deployments. >> >> ``` >> ssl:start(). >> {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). >> {ok, Ssl} = ssl:connect(Tcp, [], 30000). >> >> =ERROR REPORT==== 12-May-2017::13:34:21 === >> SSL: hello: ssl_alert.erl:88:Fatal error: internal error >> ** exception error: no match of right hand side value >> {error,{tls_alert,"internal error"}} >> ``` >> >> It is not clear the root cause of SSL alert. Why the remote side decline >> SSL connection with ALERT 80? curl https://httpbin.org works. >> >> > It is the server that sends the alert 80, which means that the server > experienced an internal error. > > The following works fine: > > ssl:connect("httpbin.org", 443, []). > {ok,{sslsocket,{gen_tcp,#Port<0.839>,tls_connection, > undefined}, > <0.105.0>}} > > > If you first want to manually start a tcp connection and then upgrade it > to TLS the client and server need to somehow agree on this so that the > server is ready to receive the TLS > client hello when it is sent by the client. This is often referred to as > STARTTLS and is used by a lot of protocols like FTPS. > > Regards Ingela Erlang/OTP Team Ericsson AB > > > > >> curl Client Hello is following >> >> ``` >> TLSv1.2 Record Layer: Handshake Protocol: Client Hello >> Content Type: Handshake (22) >> Version: TLS 1.0 (0x0301) >> Length: 224 >> Handshake Protocol: Client Hello >> Handshake Type: Client Hello (1) >> Length: 220 >> Version: TLS 1.2 (0x0303) >> Random >> Session ID Length: 0 >> Cipher Suites Length: 110 >> Cipher Suites (55 suites) >> Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 >> (0xc02c) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 >> (0xc02b) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 >> (0xc024) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 >> (0xc023) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) >> Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) >> Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) >> Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) >> Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) >> Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) >> Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) >> Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) >> Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) >> Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) >> Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (0xc007) >> Cipher Suite: TLS_ECDHE_RSA_WITH_RC4_128_SHA (0xc011) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_RC4_128_SHA (0xc002) >> Cipher Suite: TLS_ECDH_RSA_WITH_RC4_128_SHA (0xc00c) >> Cipher Suite: TLS_RSA_WITH_RC4_128_SHA (0x0005) >> Cipher Suite: TLS_RSA_WITH_RC4_128_MD5 (0x0004) >> Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA384 (0x00af) >> Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA256 (0x00ae) >> Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA (0x008d) >> Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA (0x008c) >> Cipher Suite: TLS_PSK_WITH_RC4_128_SHA (0x008a) >> Cipher Suite: TLS_PSK_WITH_3DES_EDE_CBC_SHA (0x008b) >> Compression Methods Length: 1 >> Compression Methods (1 method) >> Extensions Length: 69 >> Extension: server_name >> Extension: elliptic_curves >> Extension: ec_point_formats >> Extension: signature_algorithms >> Extension: status_request >> Extension: signed_certificate_timestamp >> ``` >> >> OTP ssl lib Client Hello is following >> >> ``` >> TLSv1.2 Record Layer: Handshake Protocol: Client Hello >> Content Type: Handshake (22) >> Version: TLS 1.0 (0x0301) >> Length: 213 >> Handshake Protocol: Client Hello >> Handshake Type: Client Hello (1) >> Length: 209 >> Version: TLS 1.2 (0x0303) >> Random >> Session ID Length: 0 >> Cipher Suites Length: 100 >> Cipher Suites (50 suites) >> Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 >> (0xc02c) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 >> (0xc024) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02e) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 (0xc032) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 (0xc026) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 (0xc02a) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x009f) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 (0x00a3) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 (0x006a) >> Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) >> Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 >> (0xc02b) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 >> (0xc023) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02d) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 (0xc031) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (0xc025) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 (0xc029) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 (0x00a2) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 (0x0040) >> Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) >> Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA (0x0038) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f) >> Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc008) >> Cipher Suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA (0xc012) >> Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) >> Cipher Suite: TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA (0x0013) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA (0xc003) >> Cipher Suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA (0xc00d) >> Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) >> Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) >> Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) >> Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA (0x0032) >> Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA (0xc004) >> Cipher Suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA (0xc00e) >> Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) >> Compression Methods Length: 1 >> Compression Methods (1 method) >> Extensions Length: 68 >> Extension: elliptic_curves >> Extension: ec_point_formats >> ``` >> >> In case of curl the following Server Hello is send back >> ``` >> TLSv1.2 Record Layer: Handshake Protocol: Server Hello >> Content Type: Handshake (22) >> Version: TLS 1.2 (0x0303) >> Length: 87 >> Handshake Protocol: Server Hello >> Handshake Type: Server Hello (2) >> Length: 83 >> Version: TLS 1.2 (0x0303) >> Random >> Session ID Length: 32 >> Session ID: bbc2e52ca6918654931096e223825a4a173780c8d010837d... >> Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) >> Compression Method: null (0) >> Extensions Length: 11 >> Extension: ec_point_formats >> Extension: renegotiation_info >> ``` >> >> I can restrict ssl lib to work with TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 >> but it fails as well. >> >> ``` >> {ok, Tcp} = gen_tcp:connect("httpbin.org", 443, [binary]). >> {ok, Ssl} = ssl:connect(Tcp, [{ciphers, [{ecdhe_rsa,aes_128_gcm,null,sha256}]}], >> 30000). >> >> =ERROR REPORT==== 12-May-2017::13:49:28 === >> SSL: hello: ssl_alert.erl:88:Fatal error: internal error >> ** exception error: no match of right hand side value >> {error,{tls_alert,"internal error"}} >> ``` >> >> Thanks you in advanced! >> >> Best Regards, >> Dmitry >> >> >> _______________________________________________ >> 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 Sat May 13 12:52:36 2017 From: eranga.erl@REDACTED (Eranga Udesh) Date: Sat, 13 May 2017 16:22:36 +0530 Subject: [erlang-questions] View Compiled Binary Search Pattern Message-ID: Hi, Is there anyway to view Compiled Binary Search Pattern for debugging purposes? I need to output (dump) all content inside the Compiled Pattern. Any possibility? Thanks in advance. - Eranga -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sat May 13 17:06:20 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 13 May 2017 15:06:20 +0000 Subject: [erlang-questions] View Compiled Binary Search Pattern In-Reply-To: References: Message-ID: I don't think there is any support for this in the current or new Erlang systems. Compiled patterns are represented as magic binaries currently. This will change in Erlang/OTP 20.0 where you will have a reference type for this. But the semantics will stay the same: There is no way to go backwards. You best bet is to figure out where the creator code is. Then you can look at who creates the compiled binary search pattern. On Sat, May 13, 2017 at 12:52 PM Eranga Udesh wrote: > Hi, > > Is there anyway to view Compiled Binary Search Pattern for debugging > purposes? I need to output (dump) all content inside the Compiled Pattern. > > Any possibility? > > Thanks in advance. > - Eranga > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan@REDACTED Sat May 13 17:20:15 2017 From: duncan@REDACTED (duncan@REDACTED) Date: Sat, 13 May 2017 08:20:15 -0700 Subject: [erlang-questions] stackoverflow Message-ID: <20170513082015.7e43b23f706d1a78218bd3e1c66e57ee.57c83170fa.wbe@email23.godaddy.com> An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Sat May 13 17:26:05 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sat, 13 May 2017 17:26:05 +0200 Subject: [erlang-questions] stackoverflow In-Reply-To: <20170513082015.7e43b23f706d1a78218bd3e1c66e57ee.57c83170fa.wbe@email23.godaddy.com> References: <20170513082015.7e43b23f706d1a78218bd3e1c66e57ee.57c83170fa.wbe@email23.godaddy.com> Message-ID: That sounds like asking the Erlang community to force use of a platform to affect a particular type of popularity graphs. Also I've read bad stuff about how hard is to begin helping people on Stackoverflow, and their karma system makes it harder, why bother? Source: google://stackoverflow toxic 2017-05-13 17:20 GMT+02:00 : > Has any thought been given to using stackoverflow more so erlang would > show up on stuff like https://dailydrip-assets.s3. > amazonaws.com/DailyDrip/blog_posts/weekly-drip-8/image_0.png? > > Duncan Sparrell > sFractal Consulting LLC > iPhone, iTypo, iApologize > > _______________________________________________ > 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 Sat May 13 17:27:15 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Sat, 13 May 2017 17:27:15 +0200 Subject: [erlang-questions] stackoverflow In-Reply-To: <20170513082015.7e43b23f706d1a78218bd3e1c66e57ee.57c83170fa.wbe@email23.godaddy.com> References: <20170513082015.7e43b23f706d1a78218bd3e1c66e57ee.57c83170fa.wbe@email23.godaddy.com> Message-ID: Hi, We even not have slack overflow... "Envoy? depuis mon mobile " Eric ---- duncan@REDACTED a ?crit ---- >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan@REDACTED Sat May 13 17:36:34 2017 From: duncan@REDACTED (duncan@REDACTED) Date: Sat, 13 May 2017 08:36:34 -0700 Subject: [erlang-questions] stackoverflow Message-ID: <20170513083634.7e43b23f706d1a78218bd3e1c66e57ee.4680c3df25.wbe@email23.godaddy.com> An HTML attachment was scrubbed... URL: From duncan@REDACTED Sat May 13 17:44:04 2017 From: duncan@REDACTED (duncan@REDACTED) Date: Sat, 13 May 2017 08:44:04 -0700 Subject: [erlang-questions] stackoverflow Message-ID: <20170513084404.7e43b23f706d1a78218bd3e1c66e57ee.f8b3b53829.wbe@email23.godaddy.com> An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sat May 13 17:56:10 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Sat, 13 May 2017 17:56:10 +0200 Subject: [erlang-questions] stackoverflow In-Reply-To: <20170513084404.7e43b23f706d1a78218bd3e1c66e57ee.f8b3b53829.wbe@email23.godaddy.com> References: <20170513084404.7e43b23f706d1a78218bd3e1c66e57ee.f8b3b53829.wbe@email23.godaddy.com> Message-ID: Hi, I should have precise 'humour' in my mail. I meant that Erlang community can use a slack room for questions. But it is not that much overflowed by questions... And I personally prefer ask questions in live than find a 4 years old? answer that is maybe not relevant for my problem. That said I sometimes use stackoverflow for other languages than Erlang. Cheers "Envoy? depuis mon mobile " Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sat May 13 18:10:28 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 13 May 2017 16:10:28 +0000 Subject: [erlang-questions] RabbitMQ message consumption In-Reply-To: References: <0d7d7c34-566e-dc6b-6b4e-b10a955408b5@idmog.com> <03a65984-0064-254e-8fa7-72709d07b5ce@idmog.com> Message-ID: On Fri, May 12, 2017 at 3:40 PM Kareem Hepburn wrote: > Gotcha. Thanks! I was using Reject earlier but I guess Ack is sufficient > to what I need to do. > > When you reject a message, you can choose if it should be requeued or not. Here it is good to build your application such that it knows if the message is likely to succeed later or not. If you can't parse the message, say, then it will never work. If your database is currently down, you can try later, for instance. Think the difference between HTTP 4xx errors (client side) or 5xx errors (server side). You want to make the discrimination because otherwise a single "poisonous" message will get sent to all your workers and that can take all the workers down by infecting them one by one. Granted, Erlang makes that harder by restarting. Yet, I've seen such problems in production. I've also seen what it does to a Python system with no supervisor restarts. It aint' pretty :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From eranga.erl@REDACTED Mon May 15 06:09:18 2017 From: eranga.erl@REDACTED (Eranga Udesh) Date: Mon, 15 May 2017 09:39:18 +0530 Subject: [erlang-questions] View Compiled Binary Search Pattern In-Reply-To: References: Message-ID: Hmm.. it would have been a wonderful thing if there was some debug command to dump the magic binary content. Anyway, thanks for the feedback. - Eranga On Sat, May 13, 2017 at 8:36 PM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > I don't think there is any support for this in the current or new Erlang > systems. Compiled patterns are represented as magic binaries currently. > This will change in Erlang/OTP 20.0 where you will have a reference type > for this. But the semantics will stay the same: There is no way to go > backwards. You best bet is to figure out where the creator code is. Then > you can look at who creates the compiled binary search pattern. > > On Sat, May 13, 2017 at 12:52 PM Eranga Udesh > wrote: > >> Hi, >> >> Is there anyway to view Compiled Binary Search Pattern for debugging >> purposes? I need to output (dump) all content inside the Compiled Pattern. >> >> Any possibility? >> >> Thanks in advance. >> - Eranga >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arunp@REDACTED Mon May 15 06:56:58 2017 From: arunp@REDACTED (Arun) Date: Mon, 15 May 2017 10:26:58 +0530 Subject: [erlang-questions] What the reason for connection closed error message.? Message-ID: <5919351A.1040808@utl.in> Hi, I am running my application on a distributed way, with one server node and multiple client nodes and all nodes are started in *visible* mode. A SNMP agent is running in the server node and I have a GUI through which I can access all the nodes in the distributed system. The SNMP query will be landing in the server node and which further does rpc to the specific client node and serve the query. The problem what I am facing is that after the complete nodes are up while accessing properties of some client nodes, the server node is getting node down messages for most of the client nodes connected to it with reason "*connection_closed*" . The physical connection is intact and there is no ping break between the nodes. What could be the reason for this error. ? and what are the circumstances this error can come.? Note : The tick time is set to 5 Second in all the nodes. Regards, Arun P -------------- next part -------------- An HTML attachment was scrubbed... URL: From v@REDACTED Mon May 15 08:51:00 2017 From: v@REDACTED (Valentin Micic) Date: Mon, 15 May 2017 08:51:00 +0200 Subject: [erlang-questions] What the reason for connection closed error message.? In-Reply-To: <5919351A.1040808@utl.in> References: <5919351A.1040808@utl.in> Message-ID: <51F9A928-86B2-4AF0-86DE-CA188378E167@pharos-avantgard.com> Just a thought? 1. Check your interface for errors (e.g. collisions etc.) This usually happens when your local ethernet interface and adjacent switch have different configuration (e.g. one is configured to be half-duplex, and another as full-duplex). In this case, as the traffic increases, a number of errors (e.g. collisions) on the interface increases as well, thus causing nodes to get disconnected. 2. Check the disk I/O. Sometimes, excessive disk I/O operations may cause "uninterruptible sleep". When this happens, your CPU is prevented from doing anything else but wait for disk. If this is the case, start your run-time (where excessive disk I/O is taking place) with +A attribute (this will increase a number of threads responsible for disk I/O). Kind regards V/ On 15 May 2017, at 6:56 AM, Arun wrote: > Hi, > > I am running my application on a distributed way, with one server node and multiple client nodes and all nodes are started in visible mode. A SNMP agent is running in the server node and I have a GUI through which I can access all the nodes in the distributed system. The SNMP query will be landing in the server node and which further does rpc to the specific client node and serve the query. > > The problem what I am facing is that after the complete nodes are up while accessing properties of some client nodes, the server node is getting node down messages for most of the client nodes connected to it with reason "connection_closed" . The physical connection is intact and there is no ping break between the nodes. > > What could be the reason for this error. ? and what are the circumstances this error can come.? > > Note : The tick time is set to 5 Second in all the nodes. > > Regards, > Arun P > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayanda.dube@REDACTED Mon May 15 10:11:14 2017 From: ayanda.dube@REDACTED (Ayanda Dube) Date: Mon, 15 May 2017 10:11:14 +0200 Subject: [erlang-questions] What the reason for connection closed error message.? In-Reply-To: <51F9A928-86B2-4AF0-86DE-CA188378E167@pharos-avantgard.com> References: <5919351A.1040808@utl.in> <51F9A928-86B2-4AF0-86DE-CA188378E167@pharos-avantgard.com> Message-ID: I agree with Valentin. And on his 2nd point, recommendation is usually to set +A parameter to at least 12 threads per core on which your node is deployed on. e.g. 128 on an 8 core platform should be fine. Best regards, Ayanda Erlang Solutions Ltd. On 15 May 2017 at 08:51, Valentin Micic wrote: > Just a thought? > > 1. Check your interface for errors (e.g. collisions etc.) > This usually happens when your local ethernet interface and adjacent > switch have different configuration (e.g. one is configured to be > half-duplex, and another as full-duplex). > In this case, as the traffic increases, a number of errors (e.g. > collisions) on the interface increases as well, thus causing nodes to get > disconnected. > > 2. Check the disk I/O. > Sometimes, excessive disk I/O operations may cause "uninterruptible > sleep". When this happens, your CPU is prevented from doing anything else > but wait for disk. > If this is the case, start your run-time (where excessive disk I/O is > taking place) with +A attribute (this will increase a number of threads > responsible for disk I/O). > > Kind regards > > V/ > > > On 15 May 2017, at 6:56 AM, Arun wrote: > > Hi, > > I am running my application on a distributed way, with one server node > and multiple client nodes and all nodes are started in *visible* mode. A > SNMP agent is running in the server node and I have a GUI through which I > can access all the nodes in the distributed system. The SNMP query will be > landing in the server node and which further does rpc to the specific > client node and serve the query. > > The problem what I am facing is that after the complete nodes are up while > accessing properties of some client nodes, the server node is getting node > down messages for most of the client nodes connected to it with reason " > *connection_closed*" . The physical connection is intact and there is no > ping break between the nodes. > > What could be the reason for this error. ? and what are the circumstances > this error can come.? > > Note : The tick time is set to 5 Second in all the nodes. > > Regards, > Arun P > _______________________________________________ > 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 Oliver.Korpilla@REDACTED Mon May 15 11:11:06 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Mon, 15 May 2017 11:11:06 +0200 Subject: [erlang-questions] escript in embedded mode? Message-ID: Hello. Can I somehow stimulate an escript to preload all its modules? Like "erl -mode embedded" basically. Is this feasible/doable? Can I force preload of code manually as an alternative? I have time-sensitive processing to do and processing of first request seems to be impacted by code-loading. Thank you! Oliver From alex0player@REDACTED Mon May 15 12:17:52 2017 From: alex0player@REDACTED (Alex S.) Date: Mon, 15 May 2017 13:17:52 +0300 Subject: [erlang-questions] Can't update xterm title bar from Erlang In-Reply-To: References: Message-ID: <44F892A3-5142-4C62-82EC-DBDDE2521F85@gmail.com> What I?ve noticed is you don?t output the line feed, which might mean that the IO buffer isn?t getting flushed by default. Although I am not sure. > 12 ??? 2017 ?., ? 22:28, Roger Lipscombe ???????(?): > > I have the following: > > put_progress(Format, Args) -> > io:put_chars(user, > [tsl(), io_lib:format(Format, Args), fsl()]), > io:put_chars(user, > [colored(), io_lib:format(Format, Args), reset(), "\n"]), > ok. > > tsl() -> "\e]0;". > fsl() -> "\a". > colored() -> "\e[1;44m". > reset() -> "\e[0m". > > That is: output the same message to the title bar (tsl, fsl are the tput capability names; see https://serverfault.com/a/23998/7027 ), and then (for now) also output it in colour, so that I can see if it's being called correctly. > > Unfortunately, something is messing with my tsl() and fsl() escape codes. The coloured text is coming out correctly, but the other stuff's garbage. The escape codes are correct; I've tested them at the bash prompt with "echo -e '\e]0;Hello\a'". > > So... what's screwing with them when they're output from ct_run? > > Interestingly, if I try the same at the Erlang prompt, it hangs the shell until I press Ctrl+C twice, at which point the text is output, but still messed up. > > Cheers, > Roger. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From billcyz@REDACTED Mon May 15 11:27:56 2017 From: billcyz@REDACTED (yuzhu chen) Date: Mon, 15 May 2017 21:27:56 +1200 Subject: [erlang-questions] Erlang udp server can't receive accept packets Message-ID: I've posted the same question on stackoverflow, but haven't got answers yet. So I posted this question again in here hoping for a solution. down votefavorite I have one simple udp server written in gen_server behaviour. When I run it, and try to send message by using gen_udp:send, the server replies nothing, seems like the udp server didn't accept packet successfully. Here is my code gen_udp_server.erl: -module(gen_udp_server).-behaviour(gen_server).-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -export([start_link/1]). -define(SERVER, ?MODULE). -record(state, {socket, port, local_ip, broad_ip}). start_link(Port) -> {ok, Socket} = gen_udp:open(Port, [binary, {active, false}, {reuseaddr, true}]), gen_server:start_link(?MODULE, [Socket, Port], []). init([Socket, Port]) -> {ok, #state{socket = Socket, port = Port}}. handle_cast(_Request, State) -> {noreply, State}. handle_call(_Request, _From, State) -> {noreply, State}. handle_info({udp, _Socket, _Addr, _Port, Data}, #state{socket = Socket} = State) -> inet:setopts(Socket, [{active, once}]), io:format("Server received data ~p from socket ~p~n", [Data, Socket]), {ok, State}. terminate(_Reason, {socket = LSocket}) -> gen_udp:close(LSocket). code_change(_OldVsn, State, _Extra) -> {ok, State}. Starting server on server 192.168.146.129: gen_udp_server:start_link(10000). Sending message from 192.168.146.128: {ok, Socket} = gen_udp:open(4399, [binary, {active, false}]). gen_udp:send(Socket, {192,168,146,129}, 10000, "hello"). The udp server should print some message when it receives packets, but my one failed. Can anyone help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Mon May 15 13:06:40 2017 From: sergej.jurecko@REDACTED (=?utf-8?Q?Sergej_Jure=C4=8Dko?=) Date: Mon, 15 May 2017 13:06:40 +0200 Subject: [erlang-questions] Erlang udp server can't receive accept packets In-Reply-To: References: Message-ID: <30EA5ED8-B7CF-4FE0-829C-05FED819F97B@gmail.com> Server can't receive the first packet if it is set to {active,false}. Change gen_udp:open param to {active,once} Sergej > On 15 May 2017, at 11:27, yuzhu chen wrote: > > I've posted the same question on stackoverflow, but haven't got answers yet. So I posted this question again in here hoping for a solution. > > > > down vote > <>favorite > > I have one simple udp server written in gen_server behaviour. When I run it, and try to send message by using gen_udp:send, the server replies nothing, seems like the udp server didn't accept packet successfully. Here is my code > > gen_udp_server.erl: > > -module(gen_udp_server). > -behaviour(gen_server). > -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). > > -export([start_link/1]). > > -define(SERVER, ?MODULE). > > -record(state, {socket, > port, > local_ip, > broad_ip}). > > start_link(Port) -> > {ok, Socket} = gen_udp:open(Port, [binary, > {active, false}, > {reuseaddr, true}]), > gen_server:start_link(?MODULE, [Socket, Port], []). > > init([Socket, Port]) -> > {ok, #state{socket = Socket, port = Port}}. > > handle_cast(_Request, State) -> > {noreply, State}. > > handle_call(_Request, _From, State) -> > {noreply, State}. > > handle_info({udp, _Socket, _Addr, _Port, Data}, #state{socket = Socket} = State) -> > inet:setopts(Socket, [{active, once}]), > io:format("Server received data ~p from socket ~p~n", [Data, Socket]), > {ok, State}. > > terminate(_Reason, {socket = LSocket}) -> > gen_udp:close(LSocket). > > code_change(_OldVsn, State, _Extra) -> > {ok, State}. > Starting server on server 192.168.146.129 : gen_udp_server:start_link(10000). > > Sending message from 192.168.146.128 : > > {ok, Socket} = gen_udp:open(4399, [binary, {active, false}]). > gen_udp:send(Socket, {192,168,146,129}, 10000, "hello"). > The udp server should print some message when it receives packets, but my one failed. Can anyone help me? > > _______________________________________________ > 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 Mon May 15 13:09:00 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 15 May 2017 14:09:00 +0300 Subject: [erlang-questions] Erlang udp server can't receive accept packets In-Reply-To: References: Message-ID: Hello, You are starting the port in ?passive mode? (active = false). Try to change ``` {ok, Socket} = gen_udp:open(Port, [binary, {active, true}, ...]), ``` Best Regards, Dmitry > On May 15, 2017, at 12:27 PM, yuzhu chen wrote: > > I've posted the same question on stackoverflow, but haven't got answers yet. So I posted this question again in here hoping for a solution. > > > > down vote > favorite > I have one simple udp server written in gen_server behaviour. When I run it, and try to send message by using gen_udp:send, the server replies nothing, seems like the udp server didn't accept packet successfully. Here is my code > > gen_udp_server.erl: > > -module(gen_udp_server). > -behaviour(gen_server). > -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). > > > > -export([start_link/1]). > > > > -define(SERVER, ?MODULE). > > > > -record(state, {socket, > > port > , > > local_ip > , > > broad_ip}) > . > > > start_link( > Port > ) -> > {ok > , Socket} = gen_udp:open(Port, [binary, > > {active > , false}, > > {reuseaddr > , true}]), > > gen_server:start_link( > ?MODULE, [Socket, Port], []). > > > init([ > Socket, Port > ]) -> > {ok > , #state{socket = Socket, port = Port}}. > > > handle_cast( > _Request, State > ) -> > {noreply > , State}. > > > handle_call( > _Request, _From, State > ) -> > {noreply > , State}. > > > handle_info({udp > , _Socket, _Addr, _Port, Data}, #state{socket = Socket} = State > ) -> > inet:setopts( > Socket, [{active, once}]), > > io:format( > "Server received data ~p from socket ~p~n", [Data, Socket]), > > {ok > , State}. > > > terminate( > _Reason, {socket = LSocket > }) -> > gen_udp:close( > LSocket). > > > code_change( > _OldVsn, State, _Extra > ) -> > {ok > , State}. > Starting server on server 192.168.146.129: gen_udp_server:start_link(10000). > > Sending message from 192.168.146.128: > > {ok, Socket} = gen_udp:open(4399, [binary, {active, false}]). > > gen_udp:send( > Socket, {192,168,146,129}, 10000, "hello"). > The udp server should print some message when it receives packets, but my one failed. Can anyone help me? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Mon May 15 13:17:41 2017 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 15 May 2017 12:17:41 +0100 Subject: [erlang-questions] Can't update xterm title bar from Erlang In-Reply-To: <44F892A3-5142-4C62-82EC-DBDDE2521F85@gmail.com> References: <44F892A3-5142-4C62-82EC-DBDDE2521F85@gmail.com> Message-ID: I don't need the line feed from the shell: echo -ne '\e]0;Hello\a' ; sleep 5 ...works fine. But, in terms of line-feed-flushes-buffers, maybe. Except that I immediately output something else with a line feed, and the terminal (gnome-terminal, Linux Mint) shows *something* for the escape sequence. It looks almost-correct, but it's hard to tell. I suspect something to do with how Erlang has configured the tty for (maybe) raw mode, but I don't understand enough about how that works. On 15 May 2017 at 11:17, Alex S. wrote: > What I?ve noticed is you don?t output the line feed, which might mean that > the IO buffer isn?t getting flushed by default. Although I am not sure. > > 12 ??? 2017 ?., ? 22:28, Roger Lipscombe > ???????(?): > > I have the following: > > put_progress(Format, Args) -> > io:put_chars(user, > [tsl(), io_lib:format(Format, Args), fsl()]), > io:put_chars(user, > [colored(), io_lib:format(Format, Args), reset(), > "\n"]), > ok. > > tsl() -> "\e]0;". > fsl() -> "\a". > colored() -> "\e[1;44m". > reset() -> "\e[0m". > > That is: output the same message to the title bar (tsl, fsl are the tput > capability names; see https://serverfault.com/a/23998/7027), and then > (for now) also output it in colour, so that I can see if it's being called > correctly. > > Unfortunately, something is messing with my tsl() and fsl() escape codes. > The coloured text is coming out correctly, but the other stuff's garbage. > The escape codes are correct; I've tested them at the bash prompt with > "echo -e '\e]0;Hello\a'". > > So... what's screwing with them when they're output from ct_run? > > Interestingly, if I try the same at the Erlang prompt, it hangs the shell > until I press Ctrl+C twice, at which point the text is output, but still > messed up. > > Cheers, > Roger. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Mon May 15 13:44:46 2017 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Mon, 15 May 2017 13:44:46 +0200 Subject: [erlang-questions] Erlang udp server can't receive accept packets In-Reply-To: References: Message-ID: Hello! As the gen_udp documentation states: "If the socket is not in an active mode, data can be retrieved through the recv/2,3 calls.". Unless I'm mistaken, you pass the "{active, false}" option to the server - maybe you should try "{active, true}" or {active, once}". 2017-05-15 11:27 GMT+02:00 yuzhu chen : > > I've posted the same question on stackoverflow, but haven't got answers yet. So I posted this question again in here hoping for a solution. > > > > down votefavorite > > I have one simple udp server written in gen_server behaviour. When I run it, and try to send message by using gen_udp:send, the server replies nothing, seems like the udp server didn't accept packet successfully. Here is my code > > gen_udp_server.erl: > > -module(gen_udp_server). > -behaviour(gen_server). > -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). > > -export([start_link/1]). > > -define(SERVER, ?MODULE). > > -record(state, {socket, > port, > local_ip, > broad_ip}). > > start_link(Port) -> > {ok, Socket} = gen_udp:open(Port, [binary, > > {active, false}, > {reuseaddr, true}]), > gen_server:start_link(?MODULE, [Socket, Port], []). > > init([Socket, Port]) -> > {ok, #state{socket = Socket, port = Port}}. > > handle_cast(_Request, State) -> > {noreply, State}. > > handle_call(_Request, _From, State) -> > {noreply, State}. > > handle_info({udp, _Socket, _Addr, _Port, Data}, #state{socket = Socket} = State) -> > inet:setopts(Socket, [{active, once}]), > io:format("Server received data ~p from socket ~p~n", [Data, Socket]), > {ok, State}. > > terminate(_Reason, {socket = LSocket}) -> > gen_udp:close(LSocket). > > code_change(_OldVsn, State, _Extra) -> > {ok, State}. > > Starting server on server 192.168.146.129: gen_udp_server:start_link(10000). > > Sending message from 192.168.146.128: > > {ok, Socket} = gen_udp:open(4399, [binary, {active, false}]). > gen_udp:send(Socket, {192,168,146,129}, 10000, "hello"). > > The udp server should print some message when it receives packets, but my one failed. Can anyone help me? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From arunp@REDACTED Mon May 15 13:51:19 2017 From: arunp@REDACTED (Arun) Date: Mon, 15 May 2017 17:21:19 +0530 Subject: [erlang-questions] Disable erlang crash dump generation In-Reply-To: References: Message-ID: <59199637.4060009@utl.in> Hi, I'm running erlang in an embedded environment, and there 's a requirement to maintain 15MB free memory at any point of time. To ensure the same I need to disable the generation of erlang crash dump file(erl_crash.dump) file since it may grow in size. How can this be done?? I've tried the following options: i. "+d" option when beginning to run the erlang node ii. Set the value of the environment variable ERL_CRASH_DUMP to "/dev/null"(tried this both when running the erlang application, and also setting the environment variable explicitly after running the application) *PS: I'm running the my application on Erlang/OTP 19 [erts-8.0]* Regards, Arun P -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve@REDACTED Mon May 15 14:01:14 2017 From: steve@REDACTED (Steve Strong) Date: Mon, 15 May 2017 13:01:14 +0100 Subject: [erlang-questions] Erlang udp server can't receive accept packets In-Reply-To: References: Message-ID: <4309d7d1-9072-4b17-9188-4060ebee7c33@Spark> As well as the replies talking about ?active, false?, you are also opening the socket before starting the gen_server - so any messages received by the socket would go to the mailbox of the process that called start_link, rather than the gen_server process. ?Suspect you near to do the gen_udp:open inside init/1 Cheers, Steve On 15 May 2017, 12:03 +0100, yuzhu chen , wrote: > I've posted the same question on stackoverflow, but haven't got answers yet. So I posted this question again in here hoping for a solution. > > > > down votefavorite > I have one simple udp server written in gen_server behaviour. When I run it, and try to send message by using gen_udp:send, the server replies nothing, seems like the udp server didn't accept packet successfully. Here is my code > gen_udp_server.erl: > > -module(gen_udp_server). > -behaviour(gen_server). > -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). > > -export([start_link/1]). > > -define(SERVER, ?MODULE). > > -record(state, {socket, > port, > local_ip, > broad_ip}). > > start_link(Port) -> > {ok, Socket} = gen_udp:open(Port, [binary, > {active, false}, > {reuseaddr, true}]), > gen_server:start_link(?MODULE, [Socket, Port], []). > > init([Socket, Port]) -> > {ok, #state{socket = Socket, port = Port}}. > > handle_cast(_Request, State) -> > {noreply, State}. > > handle_call(_Request, _From, State) -> > {noreply, State}. > > handle_info({udp, _Socket, _Addr, _Port, Data}, #state{socket = Socket} = State) -> > inet:setopts(Socket, [{active, once}]), > io:format("Server received data ~p from socket ~p~n", [Data, Socket]), > {ok, State}. > > terminate(_Reason, {socket = LSocket}) -> > gen_udp:close(LSocket). > > code_change(_OldVsn, State, _Extra) -> > {ok, State}. > Starting server on server 192.168.146.129:?gen_udp_server:start_link(10000). > Sending message from 192.168.146.128: > > {ok, Socket} = gen_udp:open(4399, [binary, {active, false}]). > gen_udp:send(Socket, {192,168,146,129}, 10000, "hello"). > The udp server should print some message when it receives packets, but my one failed. Can anyone help me? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawk.mattsson@REDACTED Mon May 15 16:07:02 2017 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Mon, 15 May 2017 16:07:02 +0200 Subject: [erlang-questions] escript in embedded mode? In-Reply-To: References: Message-ID: Try #!/usr/bin/env escript %% This is an -*- erlang -*- file. %%! -mode embedded main(... /H?kan On Mon, May 15, 2017 at 11:11 AM, Oliver Korpilla wrote: > Hello. > > Can I somehow stimulate an escript to preload all its modules? > > Like "erl -mode embedded" basically. > > Is this feasible/doable? > > Can I force preload of code manually as an alternative? I have > time-sensitive processing to do and processing of first request seems to be > impacted by code-loading. > > Thank you! > Oliver > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.petrauskas@REDACTED Tue May 16 12:27:02 2017 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Tue, 16 May 2017 13:27:02 +0300 Subject: [erlang-questions] Support for zip archives > 2GB Message-ID: Hi all, Documentation for the zip module says, that archives bigger than 2GB are not supported (http://erlang.org/doc/man/zip.html#id279135). I tested that and was able to extract and create an archive of ~3.6GB. Is the note in the documentation is not relevant anymore? BR, Karolis From carlsson.richard@REDACTED Tue May 16 14:06:27 2017 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Tue, 16 May 2017 14:06:27 +0200 Subject: [erlang-questions] Disable erlang crash dump generation In-Reply-To: <59199637.4060009@utl.in> References: <59199637.4060009@utl.in> Message-ID: See the documentation of the ERL_CRASH_DUMP_SECONDS variable (at the bottom of the page http://erlang.org/doc/man/erl.html): "Unix systems: This variable gives the number of seconds that the emulator is allowed to spend writing a crash dump. When the given number of seconds have elapsed, the emulator is terminated by a SIGALRM signal. If the variable is not set or set to 0 seconds (ERL_CRASH_DUMP_SECONDS=0), the runtime system does not even attempt to write the crash dump file. It only terminates." /Richard 2017-05-15 13:51 GMT+02:00 Arun : > > Hi, > > I'm running erlang in an embedded environment, and there 's a requirement > to maintain 15MB free memory > > at any point of time. To ensure the same I need to disable the generation > of erlang crash dump file(erl_crash.dump) > > file since it may grow in size. How can this be done?? > > I've tried the following options: > > i. "+d" option when beginning to run the erlang node > > ii. Set the value of the environment variable ERL_CRASH_DUMP to > "/dev/null"(tried this both when running the erlang application, and > > also setting the environment variable explicitly after running the > application) > > *PS: I'm running the my application on Erlang/OTP 19 [erts-8.0]* > Regards, > Arun P > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue May 16 18:55:18 2017 From: erlang@REDACTED (Richard Bowker) Date: Tue, 16 May 2017 09:55:18 -0700 Subject: [erlang-questions] Erlang 20 and crypto:rand_uniform/2 Message-ID: <20170516095518.841BE1DA@m0087794.ppops.net> An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed May 17 09:16:32 2017 From: erlang@REDACTED (Richard Bowker) Date: Wed, 17 May 2017 00:16:32 -0700 Subject: [erlang-questions] Erlang 20 and crypto:rand_uniform/2 Message-ID: <20170517001632.841B3994@m0087794.ppops.net> Reposting, apologies, hadn't noticed it had switched to HTML mail. Rich --- erlang@REDACTED wrote: From: "Richard Bowker" To: Subject: [erlang-questions] Erlang 20 and crypto:rand_uniform/2 Date: Tue, 16 May 2017 09:55:18 -0700 Erlang 20-RC1 gives the following warning `crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1` Is there any reason why we wouldn't want to provide a rand:uniform/2 with a matching Lo/Hi api for convenience of retrofitting? cheers Rich _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From raimo+erlang-questions@REDACTED Wed May 17 09:51:22 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 17 May 2017 09:51:22 +0200 Subject: [erlang-questions] Erlang 20 and crypto:rand_uniform/2 In-Reply-To: <20170517001632.841B3994@m0087794.ppops.net> References: <20170517001632.841B3994@m0087794.ppops.net> Message-ID: <20170517075122.GA68388@erix.ericsson.se> On Wed, May 17, 2017 at 12:16:32AM -0700, Richard Bowker wrote: > Reposting, apologies, hadn't noticed it had switched to HTML mail. > > Rich > > --- erlang@REDACTED wrote: > From: "Richard Bowker" > To: > Subject: [erlang-questions] Erlang 20 and crypto:rand_uniform/2 > Date: Tue, 16 May 2017 09:55:18 -0700 > > Erlang 20-RC1 gives the following warning > `crypto:rand_uniform/2 is deprecated and will be removed in a future > release; use rand:uniform/1` > Is there any reason why we wouldn't want to provide a rand:uniform/2 > with a matching Lo/Hi api for convenience of retrofitting? Not really. The rand module replaced the random module, and from there came no uniform/2 function. It did not exist since it is so simple to do it yourself. The function crypto:rand_uniform/2 was created from the underlying libcrypto function, which has the Lo,Hi arguments. There is so little gain in a uniform/2 function that I do not think it is worth implementing. Maybe arity 2 should be used for somehing completely different as an option list, distribution type, or whatnot... > cheers > Rich > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From natalia.chechina@REDACTED Wed May 17 11:30:17 2017 From: natalia.chechina@REDACTED (Natalia Chechina) Date: Wed, 17 May 2017 10:30:17 +0100 Subject: [erlang-questions] [ANN] Final Call for Papers: 16th ACM SIGPLAN Erlang Workshop 2017 Message-ID: FINAL CALL FOR PAPERS =============== Sixteenth ACM SIGPLAN Erlang Workshop http://erlang.org/workshop/2017/ ----------------------------------------------------------- Oxford, United Kingdom, 8 September 2017 Satellite event of the 22nd ACM SIGPLAN International Conference on Functional Programming (ICFP 2017) 3 - 9 September, 2017 The Erlang Workshop aims to bring together the open source, academic, and industrial communities of Erlang, to discuss technologies and languages related to Erlang. The Erlang model of concurrent programming has been widely emulated, for example by Akka in Scala, and even new programming languages were designed atop of the Erlang VM, such as Elixir. Therefore we would like to broaden the scope of the workshop to include systems like those mentioned above. The workshop will enable participants to familiarize themselves with recent developments on new techniques and tools, novel applications, draw lessons from users' experiences and identify research problems and common areas relevant to the practice of Erlang, Erlang-like languages, functional programming, distribution, concurrency etc. We invite three types of submissions. 1. Technical, practice, and application papers describing interesting contributions either in theoretical work or real world applications. Submission related to *Erlang, Elixir, Akka, CloudHaskell, OCaml, and * *functional programming* are welcome and encouraged. The maximum length is restricted to 12 pages. 2. Experience reports describing uses of *Erlang in the "real-world"*, Erlang libraries for specific tasks, experiences from using Erlang in specific application domains, reusable programming idioms and elegant new ways of using Erlang to approach or solve a particular problem. The maximum length for the experience report is restricted to 2 pages. 3. Poster presentations describing topics related to the workshop goals. Each includes a maximum of 2 pages of the abstract and summary. Presentations in this category will be given an hour of shared simultaneous demonstration time. Workshop Co-Chairs ------------------ Scott Lystig Fritchie, VMware, USA Natalia Chechina, Glasgow University, UK Program Committee ----------------------------- (Note: the Workshop Co-Chairs are also committee members) Clara Benac Earle, Universidad Politecnica de Madrid, Spain Richard Carlsson, Klarna, Sweden Laura M. Castro, University of A Coruna, Spain Viktoria F?rd?s, Erlang Solutions, Hungary James S. Larson, Google, USA Important Dates ----------------------- Submission deadline: Fri May 26, 2017 Author notification: Fri June 23, 2017 Final submission for the publisher: Sat July 15, 2017 Workshop date: Fri September 8, 2017 Instructions to authors -------------------------------- Papers must be submitted online via EasyChair (via the "Erlang2017" event). The submission page is https://www.easychair.org/conferences/?conf=erlang2017 Submitted papers should be in portable document format (PDF), formatted using the ACM SIGPLAN style guidelines. Each submission must adhere to SIGPLAN's republication policy. Violation risks summary rejection of the offending submission. Accepted papers will be published by the ACM and will appear in the ACM Digital Library. The proceedings will be freely available for download from the ACM Digital Library from one week before the start of the conference until two weeks after the conference. Paper submissions will be considered for poster submission in the case they are not accepted as full papers. Venue & Registration Details ------------------------------------------ For registration, please see the ICFP 2017 web site at: http://icfp17.sigplan.org/ Related Links -------------------- ICFP 2017 web site: http://icfp17.sigplan.org/ Past ACM SIGPLAN Erlang workshops: http://www.erlang.org/workshop/ Open Source Erlang: http://www.erlang.org/ EasyChair submission site: https://www.easychair.org/conferences/?conf=erlang2017 Author Information for SIGPLAN Conferences: http://www.sigplan.org/authorInformation.htm Atendee Information for SIGPLAN Events: http://www.sigplan.org/Resources/Policies/CodeOfConduct/ -- You received this message because you are subscribed to the Google Groups "erlang-workshop-sc" group. To unsubscribe from this group and stop receiving emails from it, send an email to erlang-workshop-sc+unsubscribe@REDACTED To post to this group, send email to erlang-workshop-sc@REDACTED Visit this group at https://groups.google.com/group/erlang-workshop-sc. For more options, visit https://groups.google.com/d/optout. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EW'17-poster.pdf Type: application/pdf Size: 588371 bytes Desc: not available URL: From Dinislam.Salikhov@REDACTED Fri May 19 11:06:27 2017 From: Dinislam.Salikhov@REDACTED (Salikhov Dinislam) Date: Fri, 19 May 2017 12:06:27 +0300 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation Message-ID: Hello, Is there a way to prevent erl from creating $HOME/.erlang.cookie? I run it as follows: erl -sname test_name -setcooke placeholder_cookie And VM creates ~/.erlang.cookie with some random content. -- Dinislam Salikhov | Senior Developer | Kaspersky Lab 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com From dmytro.lytovchenko@REDACTED Fri May 19 11:13:39 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Fri, 19 May 2017 11:13:39 +0200 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: References: Message-ID: The correct command line argument is -cookie, single minus -setcookie is deprecated Also you have a typo in it ? -setcoo*ke* 2017-05-19 11:06 GMT+02:00 Salikhov Dinislam < Dinislam.Salikhov@REDACTED>: > Hello, > > Is there a way to prevent erl from creating $HOME/.erlang.cookie? > I run it as follows: > erl -sname test_name -setcooke placeholder_cookie > And VM creates ~/.erlang.cookie with some random content. > > -- > Dinislam Salikhov | Senior Developer | Kaspersky Lab > 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dm.klionsky@REDACTED Fri May 19 11:17:24 2017 From: dm.klionsky@REDACTED (Dmitry Klionsky) Date: Fri, 19 May 2017 12:17:24 +0300 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: References: Message-ID: <591EB824.5010903@gmail.com> Since when -setcookie is deprecated? It's -cookie is obsolete. http://erlang.org/doc/man/erl.html On 05/19/2017 12:13 PM, Dmytro Lytovchenko wrote: > The correct command line argument is -cookie, single minus > -setcookie is deprecated > Also you have a typo in it ? -setcoo*_ke_* > > 2017-05-19 11:06 GMT+02:00 Salikhov Dinislam > >: > > Hello, > > Is there a way to prevent erl from creating $HOME/.erlang.cookie? > I run it as follows: > erl -sname test_name -setcooke placeholder_cookie > And VM creates ~/.erlang.cookie with some random content. > > -- > Dinislam Salikhov | Senior Developer | Kaspersky Lab > 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | > www.kaspersky.com > > _______________________________________________ > 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 -- BR, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dinislam.Salikhov@REDACTED Fri May 19 11:18:51 2017 From: Dinislam.Salikhov@REDACTED (Salikhov Dinislam) Date: Fri, 19 May 2017 12:18:51 +0300 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: References: Message-ID: <08f73417-a3d6-f94e-3c2a-d1fda0c15dd9@kaspersky.com> > The correct command line argument is -cookie, single minus > -setcookie is deprecated http://erlang.org/doc/man/erl.html says that *-cookie*is "obsolete flag without any effect". > Also you have a typo in it ? -setcoo*_ke _*Ah, you're right. My bad. Thank you. On 05/19/2017 12:13 PM, Dmytro Lytovchenko wrote: > The correct command line argument is -cookie, single minus > -setcookie is deprecated > Also you have a typo in it ? -setcoo*_ke_* > > 2017-05-19 11:06 GMT+02:00 Salikhov Dinislam > >: > > Hello, > > Is there a way to prevent erl from creating $HOME/.erlang.cookie? > I run it as follows: > erl -sname test_name -setcooke placeholder_cookie > And VM creates ~/.erlang.cookie with some random content. > > -- > Dinislam Salikhov | Senior Developer | Kaspersky Lab > 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | > www.kaspersky.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- Dinislam Salikhov | Senior Developer | Kaspersky Lab 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Fri May 19 11:24:13 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Fri, 19 May 2017 11:24:13 +0200 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: <08f73417-a3d6-f94e-3c2a-d1fda0c15dd9@kaspersky.com> References: <08f73417-a3d6-f94e-3c2a-d1fda0c15dd9@kaspersky.com> Message-ID: Right, i always confuse -setcookie and -cookie Not the nicest user experience with replacing a name with a similar name, and no actual error when the wrong one is used 2017-05-19 11:18 GMT+02:00 Salikhov Dinislam < Dinislam.Salikhov@REDACTED>: > > The correct command line argument is -cookie, single minus > > -setcookie is deprecated > > http://erlang.org/doc/man/erl.html says that *-cookie* is "obsolete flag > without any effect". > > > Also you have a typo in it ? -setcoo > > *ke *Ah, you're right. My bad. Thank you. > > On 05/19/2017 12:13 PM, Dmytro Lytovchenko wrote: > > The correct command line argument is -cookie, single minus > -setcookie is deprecated > Also you have a typo in it ? -setcoo*ke* > > 2017-05-19 11:06 GMT+02:00 Salikhov Dinislam com>: > >> Hello, >> >> Is there a way to prevent erl from creating $HOME/.erlang.cookie? >> I run it as follows: >> erl -sname test_name -setcooke placeholder_cookie >> And VM creates ~/.erlang.cookie with some random content. >> >> -- >> Dinislam Salikhov | Senior Developer | Kaspersky Lab >> 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Dinislam Salikhov | Senior Developer | Kaspersky Lab > 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dinislam.Salikhov@REDACTED Fri May 19 13:59:34 2017 From: Dinislam.Salikhov@REDACTED (Salikhov Dinislam) Date: Fri, 19 May 2017 14:59:34 +0300 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: References: <08f73417-a3d6-f94e-3c2a-d1fda0c15dd9@kaspersky.com> Message-ID: <1d45948e-f329-2aa3-870c-460c47cbe682@kaspersky.com> An afterthought: Wouldn't it be useful if erl would warn about incorrect options passed? IMO, it could reduce time to find some silly errors (like my own :) ). On 05/19/2017 12:24 PM, Dmytro Lytovchenko wrote: > Right, i always confuse -setcookie and -cookie > Not the nicest user experience with replacing a name with a similar > name, and no actual error when the wrong one is used > > 2017-05-19 11:18 GMT+02:00 Salikhov Dinislam > >: > > > The correct command line argument is -cookie, single minus > > -setcookie is deprecated > > http://erlang.org/doc/man/erl.html > says that *-cookie*is > "obsolete flag without any effect". > > > Also you have a typo in it ? -setcoo*_ke > > _*Ah, you're right. My bad. Thank you. > > On 05/19/2017 12:13 PM, Dmytro Lytovchenko wrote: >> The correct command line argument is -cookie, single minus >> -setcookie is deprecated >> Also you have a typo in it ? -setcoo*_ke_* >> >> 2017-05-19 11:06 GMT+02:00 Salikhov Dinislam >> > >: >> >> Hello, >> >> Is there a way to prevent erl from creating $HOME/.erlang.cookie? >> I run it as follows: >> erl -sname test_name -setcooke placeholder_cookie >> And VM creates ~/.erlang.cookie with some random content. >> >> -- >> Dinislam Salikhov | Senior Developer | Kaspersky Lab >> 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | >> www.kaspersky.com >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > -- > Dinislam Salikhov | Senior Developer | Kaspersky Lab > 39A/2 Leningradskoe shosse, Moscow, 125212, Russia |www.kaspersky.com > > -- Dinislam Salikhov | Senior Developer | Kaspersky Lab 39A/2 Leningradskoe shosse, Moscow, 125212, Russia | www.kaspersky.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri May 19 14:25:17 2017 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 19 May 2017 14:25:17 +0200 Subject: [erlang-questions] Avoid ~/.erlang.cookie creation In-Reply-To: <1d45948e-f329-2aa3-870c-460c47cbe682@kaspersky.com> References: <08f73417-a3d6-f94e-3c2a-d1fda0c15dd9@kaspersky.com> <1d45948e-f329-2aa3-870c-460c47cbe682@kaspersky.com> Message-ID: On Fri, May 19, 2017 at 1:59 PM, Salikhov Dinislam < Dinislam.Salikhov@REDACTED> wrote: > An afterthought: > Wouldn't it be useful if erl would warn about incorrect options passed? > IMO, it could reduce time to find some silly errors (like my own :) ). > > There is no way for erl to know what is a correct option or not. The -setcooke option could be something that you application gets via init:get_arguments() and uses. If you pass an incorrect VM option (i.e. the options with the '+' prefix), you do get errors. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri May 19 14:49:18 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 19 May 2017 14:49:18 +0200 Subject: [erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes In-Reply-To: <20170512130520.GA11366@erix.ericsson.se> References: <489BD294-2B8A-43A0-B16E-F442A99A433B@cs.otago.ac.nz> <20170428084200.GA79301@erix.ericsson.se> <20170428122848.GB79301@erix.ericsson.se> <20170502113345.GA47815@erix.ericsson.se> <20170511150254.GA42274@erix.ericsson.se> <20170512130520.GA11366@erix.ericsson.se> Message-ID: <20170519124918.GA64498@erix.ericsson.se> On Fri, May 12, 2017 at 03:05:20PM +0200, Raimo Niskanen wrote: > On Thu, May 11, 2017 at 05:02:54PM +0200, Raimo Niskanen wrote: > > On Tue, May 02, 2017 at 01:33:45PM +0200, Raimo Niskanen wrote: > > > On Tue, May 02, 2017 at 09:44:35AM +1200, Richard A. O'Keefe wrote: > > > > > > > > > On 29/04/2017, at 12:28 AM, Raimo Niskanen wrote: > > > > > > > > > > It is difficult to reliably detect the other direction i.e in the driver > > > > > when you get an address from e.g getsockname(); is it an empty string or an > > > > > abstract address? > > > > > > > > Surely an empty string would never have been legal, > > > > so if the first byte is NUL and the host supports abstract > > > > addresses, it must be an abstract address? > > > > > > > > > > If the first byte is NUL and the length is larger than 0 then it must be an > > > abstract address. But when this comes from above (from Erlang) and since > > > we do not know if the host supports abstract addresses; if we give > > > the kernel a first byte NUL but address length longer than SUN_LEN(su), > > > will then we cause harm on some OS? > > > > > > I will assume not and rewrite the code, soonish... > > > > I now have a solution that looks at .sun_len if it exists, otherwise trusts > > the leading zero. > > I was wrong. .sun_len says the same as the argument size parameter so that > was a dead end. > > > > That works on all platforms but Solaris since it has no .sun_len and when > > I get an address from e.g getsockname() on an unbound socket it is all 0's > > and the *lenght parameter from getsockname() is unaltered, so that has to > > be translated to 108 zeros. My code on all other platforms (OpenBSD, > > FreeBSD, Linux, Mac OS X) detect this as a zero length address... > > > > I need a way to fix this on Solaris! > > Now also on FreeBSD and OpenBSD... > > > > > Any ideas? I had to resort to checking for the preprocessor constant __linux__ as an indication of whether AF_UNIX supports Abstract Addresses. I feel unclean, but the problem seems to be solved. Coming in OTP-20.0-rc2. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From uwe@REDACTED Sat May 20 23:40:53 2017 From: uwe@REDACTED (Richard Carlsson) Date: Sun, 21 May 2017 02:40:53 +0500 Subject: [erlang-questions] =?utf-8?q?useful_information?= Message-ID: <1859541003.20170521004053@dauernheim.net> Hey! I thought this information might be useful for you too, please read more here http://head.lyingprophet.com Kind regards, Richard Carlsson From: erlang-questions [mailto:erlang-questions@REDACTED] Sent: Saturday, May 20, 2017 5:40 PM To: uwe@REDACTED Subject: ooo I'll try that! Also a December 31st baby, and every year is basically people shooting down the idea of having a birthday party because they wanna go get fucked up on the beach for new years. Other than that, any decent friends I have have family do's to go to, so I'm mostly just on a bender from Christmas until January 2nd. Sent from Mail for Windows 10 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0686AE00999DD2AA3C8E31FCC5A07322.jpg Type: image/jpeg Size: 17193 bytes Desc: not available URL: From billcyz@REDACTED Sun May 21 12:24:33 2017 From: billcyz@REDACTED (yuzhu chen) Date: Sun, 21 May 2017 22:24:33 +1200 Subject: [erlang-questions] Why Data is needed in ets heir? Message-ID: When setting up ets heir, I found "HeirData" is included in the heir option *{heir,Pid,HeirData}*, I'm confused why it is needed. Can anyone tell me the reason of it? Is there any direct way to setup ets heir when the ets table is created? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun May 21 13:31:31 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 21 May 2017 11:31:31 +0000 Subject: [erlang-questions] Why Data is needed in ets heir? In-Reply-To: References: Message-ID: Hi, When an ETS table is given away through an heir, the receiving process (of the ETS table) receives a message of the form {'ETS-TRANSFER',tid(),FromPid,HeirData} The `HeirData` field allows you to send auxiliary information through to the heir when the transfer happens. For instance some information about the ETS table in question. Usually heir-transfer happens when a process crashes, so you may not get a chance to send extra information through a normal message. Furthermore, you would have to align two messages to each other in the recevier which tend to be more complicated. On Sun, May 21, 2017 at 1:05 PM yuzhu chen wrote: > When setting up ets heir, I found "HeirData" is included in the heir > option *{heir,Pid,HeirData}*, I'm confused why it is needed. Can anyone > tell me the reason of it? Is there any direct way to setup ets heir when > the ets table is created? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.petrauskas@REDACTED Mon May 22 08:05:45 2017 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Mon, 22 May 2017 09:05:45 +0300 Subject: [erlang-questions] Support for zip archives > 2GB In-Reply-To: References: Message-ID: Hello, Maybe you can point me, where to look for the cause of the limitation? Karolis On Tue, May 16, 2017 at 1:27 PM, Karolis Petrauskas wrote: > Hi all, > > Documentation for the zip module says, that archives bigger than 2GB > are not supported (http://erlang.org/doc/man/zip.html#id279135). I > tested that and was able to extract and create an archive of ~3.6GB. > Is the note in the documentation is not relevant anymore? > > BR, > Karolis From jakobce@REDACTED Mon May 22 09:51:43 2017 From: jakobce@REDACTED (Jakob Cederlund) Date: Mon, 22 May 2017 09:51:43 +0200 Subject: [erlang-questions] Support for zip archives > 2GB In-Reply-To: References: Message-ID: The zip module currently only supports 32-bit zip, so there are some 4Gb limitations. (There is an extended format, which most utilities can use. https://en.wikipedia.org/wiki/Zip_(file_format)#ZIP64 ) /Jakob 2017-05-22 8:05 GMT+02:00 Karolis Petrauskas : > Hello, > > Maybe you can point me, where to look for the cause of the limitation? > > Karolis > > On Tue, May 16, 2017 at 1:27 PM, Karolis Petrauskas > wrote: > > Hi all, > > > > Documentation for the zip module says, that archives bigger than 2GB > > are not supported (http://erlang.org/doc/man/zip.html#id279135). I > > tested that and was able to extract and create an archive of ~3.6GB. > > Is the note in the documentation is not relevant anymore? > > > > BR, > > Karolis > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithunb@REDACTED Mon May 22 09:17:32 2017 From: mithunb@REDACTED (Mithun B) Date: Mon, 22 May 2017 12:47:32 +0530 Subject: [erlang-questions] Disable MnesiaCore dump file generation Message-ID: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> Hi all, I have an application using Mnesia Database running is a memory constrained environment. So is there any way to disable MnesiaCore file creation by when something goes wrong with Mnesia which is a default case? Or is it possible to give limit on the size of file or constraint on count of files? Since the MnesiaCore file gets created with different name each time, it will not overwrite the previous one. It casuses flooding of MnesiaCore files in the working directory of my application, if the application has crashed for multiple times. Regards, Mithun B From lawrence.ansell@REDACTED Mon May 22 11:58:05 2017 From: lawrence.ansell@REDACTED (Lawrence Ansell) Date: Mon, 22 May 2017 10:58:05 +0100 Subject: [erlang-questions] [ANN] EUC17Conference - Early Bird Ends Today! Message-ID: http://www.erlang-factory.com/euc2017#register -- Lawrence Ansell Conference Marketing Co-ordinator Erlang User Conference - Stockholm - 7-9 June (Early Bird Ends 22 May) EFL Buenos Aires - Buenos Aires - 30 June Elixir.LDN - London - 17 August Code Mesh - London - 7-9 November -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon May 22 16:26:50 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 22 May 2017 14:26:50 +0000 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 Message-ID: Hi, I'm happy to announce that ShopGun's GraphQL code is now open source: https://github.com/shopgun/graphql-erlang GraphQL (http://graphql.org) is a query language for the web which is an alternative to RESTful web services. There are some similarity to Joe's UBF stack as well, though it is a completely different take. Originally from Facebook, we implement a GraphQL engine which is almost fully featured in Erlang. I have a talk at the Erlang Users Conference 2017 on this project, but we are releasing the system early since we are far enough in its lifetime to do so, and there is little reason to keep it closed anymore. If you are interested in this project, please come see the talk :) Because GraphQL is a fairly large system, there is an accompanying tutorial to the project, which uses the graphql backend: https://github.com/shopgun/graphql-erlang-tutorial and it has a quite complete tutorial book written as well (pending some sections which is still being written) https://shopgun.github.io/graphql-erlang-tutorial/ It is our hope that the tutorial will help people use the repository and build some great software on top of it. As always, comments are welcome. Either in this thread or in Issues in the projects if need be. PRs are also accepted and we want to encourage an open development strategy on the system. While the project probably still has some rough edges, we expect to grind them down over the coming months. Happy Hacking on behalf of the ShopGun team :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.safarov@REDACTED Mon May 22 20:02:08 2017 From: s.safarov@REDACTED (Sergey Safarov) Date: Mon, 22 May 2017 18:02:08 +0000 Subject: [erlang-questions] Disable MnesiaCore dump file generation In-Reply-To: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> References: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> Message-ID: You can change working directory to separate volume with limited size. As example mount to. /run/myapp directory "tmp" volume with size 10 Mbyte. Then cd to /run/myapp ??, 22 ??? 2017, 13:21 Mithun B : > Hi all, > > I have an application using Mnesia Database running is a memory > constrained environment. So is there any way to disable MnesiaCore file > creation by when something goes wrong with Mnesia which is a default > case? Or is it possible to give limit on the size of file or constraint > on count of files? > > Since the MnesiaCore file gets created with different name each > time, it will not overwrite the previous one. It casuses flooding of > MnesiaCore files in the working directory of my application, if the > application has crashed for multiple times. > > Regards, > > Mithun B > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Mon May 22 21:32:09 2017 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 22 May 2017 19:32:09 +0000 Subject: [erlang-questions] Disable MnesiaCore dump file generation In-Reply-To: References: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> Message-ID: You can set the core dir with the config parameter: http://erlang.org/doc/man/mnesia.html#write_lock_table-1 erl -mnesia core_dir Directory On Mon, May 22, 2017 at 8:02 PM Sergey Safarov wrote: > You can change working directory to separate volume with limited size. As > example mount to. /run/myapp directory "tmp" volume with size 10 Mbyte. > Then cd to /run/myapp > > ??, 22 ??? 2017, 13:21 Mithun B : > >> Hi all, >> >> I have an application using Mnesia Database running is a memory >> constrained environment. So is there any way to disable MnesiaCore file >> creation by when something goes wrong with Mnesia which is a default >> case? Or is it possible to give limit on the size of file or constraint >> on count of files? >> >> Since the MnesiaCore file gets created with different name each >> time, it will not overwrite the previous one. It casuses flooding of >> MnesiaCore files in the working directory of my application, if the >> application has crashed for multiple times. >> >> Regards, >> >> Mithun B >> >> _______________________________________________ >> 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 jesper.louis.andersen@REDACTED Mon May 22 21:43:30 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 22 May 2017 19:43:30 +0000 Subject: [erlang-questions] Disable MnesiaCore dump file generation In-Reply-To: References: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> Message-ID: Let me add that it is often a good idea to separate your data directories from your code directories. Preferably by volume and quota as well. While here, establish logs isolated as well and make sure they are rotated so they only use a limited amount of memory. If possible, enable disk_sup or make a warning system so you can detect situations where you are about to run low on disk through the alarm_handler. On Mon, May 22, 2017 at 9:32 PM Dan Gudmundsson wrote: > > You can set the core dir with the config parameter: > http://erlang.org/doc/man/mnesia.html#write_lock_table-1 > > erl -mnesia core_dir Directory > > On Mon, May 22, 2017 at 8:02 PM Sergey Safarov > wrote: > >> You can change working directory to separate volume with limited size. As >> example mount to. /run/myapp directory "tmp" volume with size 10 Mbyte. >> Then cd to /run/myapp >> >> ??, 22 ??? 2017, 13:21 Mithun B : >> >>> Hi all, >>> >>> I have an application using Mnesia Database running is a memory >>> constrained environment. So is there any way to disable MnesiaCore file >>> creation by when something goes wrong with Mnesia which is a default >>> case? Or is it possible to give limit on the size of file or constraint >>> on count of files? >>> >>> Since the MnesiaCore file gets created with different name each >>> time, it will not overwrite the previous one. It casuses flooding of >>> MnesiaCore files in the working directory of my application, if the >>> application has crashed for multiple times. >>> >>> Regards, >>> >>> Mithun B >>> >>> _______________________________________________ >>> 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 mithunb@REDACTED Tue May 23 07:19:53 2017 From: mithunb@REDACTED (Mithun B) Date: Tue, 23 May 2017 10:49:53 +0530 Subject: [erlang-questions] Disable MnesiaCore dump file generation In-Reply-To: References: <5363a0d9-3ff2-80e7-90ec-a0082368de01@utl.in> Message-ID: <7c03a9a8-4751-88f7-ee4e-a7a96a0896e7@utl.in> Thank you all, But I am looking for simpler solution like, this one: https://stackoverflow.com/a/18526512/3232487 Here the generation of erl_crash.dump is entirely avoided by redirecting to /dev/null Regards, Mithun B On Tuesday 23 May 2017 01:13 AM, Jesper Louis Andersen wrote: > Let me add that it is often a good idea to separate your data > directories from your code directories. Preferably by volume and quota > as well. While here, establish logs isolated as well and make sure > they are rotated so they only use a limited amount of memory. If > possible, enable disk_sup or make a warning system so you can detect > situations where you are about to run low on disk through the > alarm_handler. > > > > On Mon, May 22, 2017 at 9:32 PM Dan Gudmundsson > wrote: > > > You can set the core dir with the config parameter: > http://erlang.org/doc/man/mnesia.html#write_lock_table-1 > > erl -mnesia core_dir Directory > > On Mon, May 22, 2017 at 8:02 PM Sergey Safarov > > wrote: > > You can change working directory to separate volume with > limited size. As example mount to. /run/myapp directory "tmp" > volume with size 10 Mbyte. Then cd to /run/myapp > > > ??, 22 ??? 2017, 13:21 Mithun B >: > > Hi all, > > I have an application using Mnesia Database running > is a memory > constrained environment. So is there any way to disable > MnesiaCore file > creation by when something goes wrong with Mnesia which is > a default > case? Or is it possible to give limit on the size of file > or constraint > on count of files? > > Since the MnesiaCore file gets created with different > name each > time, it will not overwrite the previous one. It casuses > flooding of > MnesiaCore files in the working directory of my > application, if the > application has crashed for multiple times. > > Regards, > > Mithun B > > _______________________________________________ > 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 max.lapshin@REDACTED Tue May 23 21:30:09 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 23 May 2017 22:30:09 +0300 Subject: [erlang-questions] Getting count of suites/cases from common test hook In-Reply-To: References: Message-ID: handle_event(#event{name=start_info, data = {_NoOfTests,_NoOfSuites,NoOfCases}}, #state{} =State) -> {ok, State#state{cases = NoOfCases}}; handle_event(#event{name=tc_done, data = _Data}, #state{done = Done, started_at = Start} =State) -> Out = io_lib:format("~5.2f% ~Bs", [Done1*100/State#state.cases, (now_ms() - Start) div 1000]), io:format(standard_error, "~s\e[~BD", [Out, iolist_size(Out)]), {ok, State#state{done = Done1}}; handle_event(#event{name=test_stats,data = {Ok,Failed,{UserSkipped,AutoSkipped}}}, #state{} = State) -> {ok, State#state{ ok = Ok + State#state.ok, failed = Failed + State#state.failed, skipped = UserSkipped + AutoSkipped + State#state.skipped }}; handle_event(#event{name=test_done}, #state{} =State) -> io:format(standard_error, "Total: ~Bs \n" .... ct_run calculates number of test cases before start, so you can make a spinner with percents. -------------- next part -------------- An HTML attachment was scrubbed... URL: From son@REDACTED Wed May 24 04:22:56 2017 From: son@REDACTED (Son Tran-Nguyen) Date: Tue, 23 May 2017 21:22:56 -0500 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: References: Message-ID: Hi Jesper, I just want to say thank you for open source this. You can't imagine how grateful I am to read that the library use binary for keys. Other implementations in Elixir use atoms everywhere. With server that can take a dynamic schema from users, using atoms is just bound to fill Erlang's atom table. Again, thank you. I'm looking forward to using this. On Mon, May 22, 2017 at 9:26 AM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > Hi, > > I'm happy to announce that ShopGun's GraphQL code is now open source: > > https://github.com/shopgun/graphql-erlang > > GraphQL (http://graphql.org) is a query language for the web which is an > alternative to RESTful web services. There are some similarity to Joe's UBF > stack as well, though it is a completely different take. Originally from > Facebook, we implement a GraphQL engine which is almost fully featured in > Erlang. > > I have a talk at the Erlang Users Conference 2017 on this project, but we > are releasing the system early since we are far enough in its lifetime to > do so, and there is little reason to keep it closed anymore. If you are > interested in this project, please come see the talk :) > > Because GraphQL is a fairly large system, there is an accompanying > tutorial to the project, which uses the graphql backend: > > https://github.com/shopgun/graphql-erlang-tutorial > > and it has a quite complete tutorial book written as well (pending some > sections which is still being written) > > https://shopgun.github.io/graphql-erlang-tutorial/ > > It is our hope that the tutorial will help people use the repository and > build some great software on top of it. > > As always, comments are welcome. Either in this thread or in Issues in the > projects if need be. PRs are also accepted and we want to encourage an open > development strategy on the system. While the project probably still has > some rough edges, we expect to grind them down over the coming months. > > Happy Hacking on behalf of the ShopGun team :) > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lankeanandrao@REDACTED Wed May 24 07:50:30 2017 From: lankeanandrao@REDACTED (lankeanandrao) Date: Wed, 24 May 2017 11:20:30 +0530 Subject: [erlang-questions] Erlang application will affect Erlang kernel net tick time operation ?. Message-ID: Hi all, If the Erlang application is loaded with too many print statements i.e io:format, will it affect the Erlang kernel net tick time operation?. and also I want to know, in what situation Erlang "node_down_reason" as "connection_closed" will come. Here I am running two Erlang nodes in visible mode Example : a@REDACTED running with net tick time as 5 sec. and another node b@REDACTED running with net tick time as 4 times greater than the other node, on both the nodes a Erlang program is running which will just print the kernel messages received as node_down or node_up. In the above scenario the node which is running with more tick time is receiving node_down_reason as "connection_closed" and the other node which is running with less tick time is receiving node_down_reason as "net_tick_time_out". Regards, Anand Rao L From Tobias.Schlager@REDACTED Wed May 24 08:59:45 2017 From: Tobias.Schlager@REDACTED (Tobias Schlager) Date: Wed, 24 May 2017 06:59:45 +0000 Subject: [erlang-questions] Erlang application will affect Erlang kernel net tick time operation ?. In-Reply-To: References: Message-ID: <12F2115FD1CCEE4294943B2608A18FA301C2976CB8@MAIL01.win.lbaum.eu> Hi Anand, here's the relevant quote from the kernel application documentation [1]: 'Notice that all communicating nodes are to have the same TickTime value specified.' You are not supposed to run several connected Erlang nodes with different tick times. That's most probably the reason, for the node down messages you encounter. Regards Tobias [1] http://erlang.org/doc/man/kernel_app.html From Oliver.Korpilla@REDACTED Wed May 24 09:03:52 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 24 May 2017 09:03:52 +0200 Subject: [erlang-questions] BEAM performance? Message-ID: An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Wed May 24 09:06:26 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Wed, 24 May 2017 09:06:26 +0200 Subject: [erlang-questions] BEAM performance? In-Reply-To: References: Message-ID: First thing to consider, use HiPE on everything or nothing at all. Switching between normal Erlang and HiPE native code is expensive. On May 24, 2017 9:04 AM, "Oliver Korpilla" wrote: > Hello. > > We wrote a moderately complex telco application at work using elixir, but > I think the performance we observe would be similar in Erlang since > basically it all depends on BEAM and OTP anyway, so please don't mind me > asking here. > > We run message scenarios that involve ASN.1 encoding/decoding, several IP > protocols, a proprietary transport we access through an Erlang port, etc. > Message sequences will be handled through gen_fsm processes. > > The application is split over several nodes. > > What we've observed is: > * First time scenario runs is super slow. > * Second time, time is halved. > * Third time, performance is very good, especially given the complex > scenario. > > When analyzing bottlenecks in the software, we observed and tried the > following: > * I preloaded all modules into the VM and times improved significantly. > * ASN.1 encoding on 1st try can take as much as 20ms on first run but go > <1ms after for same message with minimally different content. > * Using HiPE on the ASN.1 generated codec did worsen performance. > * Executing the message codec at least once during startup improved ASN.1 > performance the most. > * Two DB writes to same table row in short order can significantly > decrease performance by causing multi-ms delays. > > (I know this is probably no surprise to anyone here but we're learning how > the system behaves during runtime.) > > The curve described above still persists - the totals are just less. > > Our working assumption is that caching is impacting performance here, but > we actually know too little about the BEAM runtime. > > * Are there mechanisms internal to BEAM impacting this? Or is it purely a > property of the CPU architecture? > * Could I stimulate BEAM to cache certain parts of the code ahead of time? > > The measurements are rough ones, done by log timestamps. ms granularity is > enough for us to gauge overall performance of our signalling. > > Message performance for user 3 and onward are okay but users 1 and/or 2 > could be dropped because of timeouts, so optimizing these still matters. > > Thank you for any advice you can give, > Oliver > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Oliver.Korpilla@REDACTED Wed May 24 09:08:03 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 24 May 2017 09:08:03 +0200 Subject: [erlang-questions] Mnesia tables don't get shared Message-ID: An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Wed May 24 14:46:32 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 24 May 2017 14:46:32 +0200 Subject: [erlang-questions] Mnesia tables don't get shared In-Reply-To: References: Message-ID: <20170524124632.GA17182@erix.ericsson.se> I am sorry but I and many others will not read HTML-only posts. On Wed, May 24, 2017 at 09:08:03AM +0200, Oliver Korpilla wrote: >
Hello.
> >
 
> >
We're using Mnesia in a distributed application but when running our scenario tests we observe the following:
> >
 
> >
Between 2%-7% of our scenarios fail because the DB tables don't get shared between nodes.
> >
 
> >
When new "slave" (not by API, just by function) nodes come up, we remotely call the master and add table copies, then wait for the tables. In all our failed scenarios, the tables don't get shared in time (= 2s).
> >
 
> >
Are there other factors impacting how and when tables are shared in distributed Mnesia? We've been playing with various values for the wait time but the problem has never entirely gone away.
> >
 
> >
Thank you and best regards,
> >
Oliver
> _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From Oliver.Korpilla@REDACTED Wed May 24 15:00:59 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 24 May 2017 15:00:59 +0200 Subject: [erlang-questions] Mnesia tables don't get shared Message-ID: Hello. ? We're using Mnesia in a distributed application but when running our scenario tests we observe the following: ? Between 2%-7% of our scenarios fail because the DB tables don't get shared between nodes. ? When new "slave" (not by API, just by function) nodes come up, we remotely call the master and add table copies, then wait for the tables. In all our failed scenarios, the tables don't get shared in time (= 2s). ? Are there other factors impacting how and when tables are shared in distributed Mnesia? We've been playing with various values for the wait time but the problem has never entirely gone away. ? Thank you and best regards, Oliver ? (Reposted in text on request by Raimo) From Oliver.Korpilla@REDACTED Wed May 24 15:01:55 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 24 May 2017 15:01:55 +0200 Subject: [erlang-questions] BEAM performance? Message-ID: Hello. ? We wrote a moderately complex telco application at work using elixir, but I think the performance we observe would be similar in Erlang since basically it all depends on BEAM and OTP anyway, so please don't mind me asking here. ? We run message scenarios that involve ASN.1 encoding/decoding, several IP protocols, a proprietary transport we access through an Erlang port, etc. Message sequences will be handled through gen_fsm processes. ? The application is split over several nodes. ? What we've observed is: * First time scenario runs is super slow. * Second time, time is halved. * Third time, performance is very good, especially given the complex scenario. ? When analyzing bottlenecks in the software, we observed and tried the following: *?I preloaded all modules into the VM and times improved significantly.? * ASN.1 encoding on 1st try can take as much as 20ms on first run but go <1ms after for same message with minimally different content. * Using HiPE on the ASN.1 generated codec did worsen performance. * Executing the message codec at least once during startup improved ASN.1 performance the most. * Two DB writes to same table row in short order can significantly decrease performance by causing multi-ms delays. ? (I know this is probably no surprise to anyone here but we're learning how the system behaves during runtime.) ? The curve described?above still persists - the totals are just less. ? Our working assumption is that caching is impacting performance here, but we actually know too little about the BEAM runtime. ? * Are there mechanisms internal to BEAM impacting this? Or is it purely a property of the CPU architecture? * Could I stimulate BEAM to cache certain parts of the code ahead of time?? ? The measurements are rough ones, done by log timestamps. ms granularity is enough for us to gauge overall performance of our signalling. ? Message performance for user 3 and onward are okay but users 1 and/or 2 could be dropped because of timeouts, so optimizing these still matters. ? Thank you for any advice you can give, Oliver (Resent on Raimo's request) From jesper.louis.andersen@REDACTED Wed May 24 15:08:45 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 24 May 2017 13:08:45 +0000 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: References: Message-ID: Hi Son, You can create a safe hybrid solution in GraphQL which uses atoms, and it is one of the changes we are considering. The parser will produce binary/string data since it is in the control of the client and we can't trust the client. But in the elaboration step, we can run list_to_existing_atom/1 and binary_to_existing_atom/1. If we don't happen to have that atom we know the query is structurally invalid and we can just reject it. If it is structurally valid, we can safely convert into atoms and use them. GraphQL is a statically typed system and we can use this fact to handle it safely. The reason we are considering the change is that it would be more idiomatic than the current solution. One particular strong point is that the dialyzer is able to describe maps in which the domain is given by atoms. But it can't describe maps in which the domain are binaries. The reason we use binaries right now is that it was the easy solution. The system does allow atom-use in the 'enum' types for now, but we plan on folding enum handling into a solution which is more akin to scalar handling. This moves the flexibility onto the developer and we don't have to add code to the graphql system whenever people want a new encoding of enums. GraphQL is a fairly big system and mapping it onto the Erlang world took some trial and error. Some of the trials turned out to be less optimal. But one also has to put a foot down at some point and get something out rather than keeping to optimize for elegance. Now, having said all that: if you just blindly convert client-side-data into atoms, you can easily get into trouble with clients: either maliciously or innocently, and this is a choice that should be rejected IMO. On Wed, May 24, 2017 at 4:23 AM Son Tran-Nguyen wrote: > Hi Jesper, > > I just want to say thank you for open source this. You can't imagine how > grateful I am to read that the library use binary for keys. Other > implementations in Elixir use atoms everywhere. With server that can take a > dynamic schema from users, using atoms is just bound to fill Erlang's atom > table. > > Again, thank you. I'm looking forward to using this. > > On Mon, May 22, 2017 at 9:26 AM, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> Hi, >> >> I'm happy to announce that ShopGun's GraphQL code is now open source: >> >> https://github.com/shopgun/graphql-erlang >> >> GraphQL (http://graphql.org) is a query language for the web which is an >> alternative to RESTful web services. There are some similarity to Joe's UBF >> stack as well, though it is a completely different take. Originally from >> Facebook, we implement a GraphQL engine which is almost fully featured in >> Erlang. >> >> I have a talk at the Erlang Users Conference 2017 on this project, but we >> are releasing the system early since we are far enough in its lifetime to >> do so, and there is little reason to keep it closed anymore. If you are >> interested in this project, please come see the talk :) >> >> Because GraphQL is a fairly large system, there is an accompanying >> tutorial to the project, which uses the graphql backend: >> >> https://github.com/shopgun/graphql-erlang-tutorial >> >> and it has a quite complete tutorial book written as well (pending some >> sections which is still being written) >> >> https://shopgun.github.io/graphql-erlang-tutorial/ >> >> It is our hope that the tutorial will help people use the repository and >> build some great software on top of it. >> >> As always, comments are welcome. Either in this thread or in Issues in >> the projects if need be. PRs are also accepted and we want to encourage an >> open development strategy on the system. While the project probably still >> has some rough edges, we expect to grind them down over the coming months. >> >> Happy Hacking on behalf of the ShopGun team :) >> >> >> >> _______________________________________________ >> 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 Wed May 24 15:19:38 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 24 May 2017 13:19:38 +0000 Subject: [erlang-questions] BEAM performance? In-Reply-To: References: Message-ID: On Wed, May 24, 2017 at 3:02 PM Oliver Korpilla wrote: > > * Are there mechanisms internal to BEAM impacting this? Or is it purely a > property of the CPU architecture? > If you experience latencies in the millisecond range, I don't think you are looking at a CPU caching problem. A DRAM hit is 300ns or 0.3us. So you'd need about 3000 of those to hit 1ms run time. The napkin math doesn't really pan out too well. Do you run the ERTS in embedded mode[0]? I'd look at code loading. Or perhaps ASN.1 loading initially if it compiles stuff the first time around. As for the two DB writes to the same row in short order: Mnesia uses an optimistic locking strategy. If two transactions write to the same row at the same time, both will aborted, wait a bit and try again. If you're unlucky, those two writes will keep interfering with each other and you will get lag. A good way around this is a design which serializes such writes. Or perhaps you can make the write dirty (this can actually be safe in some situations, depending on your setup). [0] http://erlang.org/doc/system_principles/system_principles.html#code_loading -------------- next part -------------- An HTML attachment was scrubbed... URL: From Oliver.Korpilla@REDACTED Wed May 24 15:41:27 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 24 May 2017 15:41:27 +0200 Subject: [erlang-questions] BEAM performance? In-Reply-To: References: Message-ID: Hello, Jesper. My "worst" Mnesia write collision I could fix by making a single transaction out of two. That was just bad coding. We also occasionally encounter slow writes but I think that's due to what you described. Unfortunately due to a restriction that is completely our fault we're not running in embedded mode. But I call ensure_loaded on all BEAM modules I can find in our build directory... (There seems to be no easy way to extract all beam modules in the system or to enter embedded mode during runtime?) I will still investigate whether I can get it to run in embedded mode. Thank you, Oliver ? ? Gesendet:?Mittwoch, 24. Mai 2017 um 15:19 Uhr Von:?"Jesper Louis Andersen" An:?"Oliver Korpilla" , erlang-questions@REDACTED Betreff:?Re: [erlang-questions] BEAM performance? On Wed, May 24, 2017 at 3:02 PM Oliver Korpilla wrote: ? * Are there mechanisms internal to BEAM impacting this? Or is it purely a property of the CPU architecture? ? If you experience latencies in the millisecond range, I don't think you are looking at a CPU caching problem. A DRAM hit is 300ns or 0.3us. So you'd need about 3000 of those to hit 1ms run time. The napkin math doesn't really pan out too well. ? Do you run the ERTS in embedded mode[0]? I'd look at code loading. Or perhaps ASN.1 loading initially if it compiles stuff the first time around. ? As for the two DB writes to the same row in short order: Mnesia uses an optimistic locking strategy. If two transactions write to the same row at the same time, both will aborted, wait a bit and try again. If you're unlucky, those two writes will keep interfering with each other and you will get lag. A good way around this is a design which serializes such writes. Or perhaps you can make the write dirty (this can actually be safe in some situations, depending on your setup). [0] http://erlang.org/doc/system_principles/system_principles.html#code_loading[http://erlang.org/doc/system_principles/system_principles.html#code_loading] From son@REDACTED Wed May 24 16:31:14 2017 From: son@REDACTED (Son Tran-Nguyen) Date: Wed, 24 May 2017 09:31:14 -0500 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: References: Message-ID: Hi Jesper, I always prefer binary use over atom. That's what I like about your library. Like you said, in my use case of handling client-side data, I definitely don't want to convert them to atoms. If any, please consider letting the develop to choose whether they want to convert the binary to atom. If the library switch itself to using atoms, then the developer cannot really do anything about it. On Wed, May 24, 2017 at 8:08 AM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > Hi Son, > > You can create a safe hybrid solution in GraphQL which uses atoms, and it > is one of the changes we are considering. The parser will produce > binary/string data since it is in the control of the client and we can't > trust the client. But in the elaboration step, we can run > list_to_existing_atom/1 and binary_to_existing_atom/1. If we don't happen > to have that atom we know the query is structurally invalid and we can just > reject it. If it is structurally valid, we can safely convert into atoms > and use them. GraphQL is a statically typed system and we can use this fact > to handle it safely. > > The reason we are considering the change is that it would be more > idiomatic than the current solution. One particular strong point is that > the dialyzer is able to describe maps in which the domain is given by > atoms. But it can't describe maps in which the domain are binaries. > > The reason we use binaries right now is that it was the easy solution. The > system does allow atom-use in the 'enum' types for now, but we plan on > folding enum handling into a solution which is more akin to scalar > handling. This moves the flexibility onto the developer and we don't have > to add code to the graphql system whenever people want a new encoding of > enums. GraphQL is a fairly big system and mapping it onto the Erlang world > took some trial and error. Some of the trials turned out to be less > optimal. But one also has to put a foot down at some point and get > something out rather than keeping to optimize for elegance. > > Now, having said all that: if you just blindly convert client-side-data > into atoms, you can easily get into trouble with clients: either > maliciously or innocently, and this is a choice that should be rejected IMO. > > > On Wed, May 24, 2017 at 4:23 AM Son Tran-Nguyen wrote: > >> Hi Jesper, >> >> I just want to say thank you for open source this. You can't imagine how >> grateful I am to read that the library use binary for keys. Other >> implementations in Elixir use atoms everywhere. With server that can take a >> dynamic schema from users, using atoms is just bound to fill Erlang's atom >> table. >> >> Again, thank you. I'm looking forward to using this. >> >> On Mon, May 22, 2017 at 9:26 AM, Jesper Louis Andersen < >> jesper.louis.andersen@REDACTED> wrote: >> >>> Hi, >>> >>> I'm happy to announce that ShopGun's GraphQL code is now open source: >>> >>> https://github.com/shopgun/graphql-erlang >>> >>> GraphQL (http://graphql.org) is a query language for the web which is >>> an alternative to RESTful web services. There are some similarity to Joe's >>> UBF stack as well, though it is a completely different take. Originally >>> from Facebook, we implement a GraphQL engine which is almost fully featured >>> in Erlang. >>> >>> I have a talk at the Erlang Users Conference 2017 on this project, but >>> we are releasing the system early since we are far enough in its lifetime >>> to do so, and there is little reason to keep it closed anymore. If you are >>> interested in this project, please come see the talk :) >>> >>> Because GraphQL is a fairly large system, there is an accompanying >>> tutorial to the project, which uses the graphql backend: >>> >>> https://github.com/shopgun/graphql-erlang-tutorial >>> >>> and it has a quite complete tutorial book written as well (pending some >>> sections which is still being written) >>> >>> https://shopgun.github.io/graphql-erlang-tutorial/ >>> >>> It is our hope that the tutorial will help people use the repository and >>> build some great software on top of it. >>> >>> As always, comments are welcome. Either in this thread or in Issues in >>> the projects if need be. PRs are also accepted and we want to encourage an >>> open development strategy on the system. While the project probably still >>> has some rough edges, we expect to grind them down over the coming months. >>> >>> Happy Hacking on behalf of the ShopGun team :) >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawk.mattsson@REDACTED Wed May 24 16:38:37 2017 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Wed, 24 May 2017 16:38:37 +0200 Subject: [erlang-questions] BEAM performance? In-Reply-To: References: Message-ID: On Wed, May 24, 2017 at 3:19 PM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > > As for the two DB writes to the same row in short order: Mnesia uses an > optimistic locking strategy. If two transactions write to the same row at > the same time, both will aborted, wait a bit and try again. If you're > unlucky, those two writes will keep interfering with each other and you > will get lag. > ?No, only one transaction will be restarted.? ?The "oldest" one will be completed. /H?kan ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Wed May 24 16:57:04 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 24 May 2017 14:57:04 +0000 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: References: Message-ID: On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen wrote: > > If any, please consider letting the develop to choose whether they want to > convert the binary to atom. If the library switch itself to using atoms, > then the developer cannot really do anything about it. > > If we make the switch, I'm pretty sure the developers won't be given a choice. The complexity of managing this will essentially mean every module in the system needs lots of small fixups. The cost/benefit analysis doesn't pan out. The impedance mismatch is when you have a field as an atom, 'created' for instance. But your object stores it as <<"created">> in a map or proplist. In this case, the code would change from execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)} to execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8), Obj, null)} which I don't think is a problem in the long run. It would help if the data is a #record{} type on the other hand. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brezal.campio@REDACTED Thu May 25 08:14:26 2017 From: brezal.campio@REDACTED (Brezal Campio) Date: Thu, 25 May 2017 00:14:26 -0600 Subject: [erlang-questions] Terminology for Rate Limiting Message-ID: For a some function which is the following: - begin with request count at 0 - check current request count - if current current is less than allowed requests - spin up a new process - way for some given time and reset count to 0 This is a naive approach to rate limiting, but is there common terminology for something like this? I am interested in less naive approaches to rate limiting requests as well if anyone is willing to point in the right direction. Ciao! -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Thu May 25 11:25:50 2017 From: pablo.platt@REDACTED (pablo platt) Date: Thu, 25 May 2017 12:25:50 +0300 Subject: [erlang-questions] Terminology for Rate Limiting In-Reply-To: References: Message-ID: Maybe Leaky bucket is relevant? https://en.wikipedia.org/wiki/Leaky_bucket On Thu, May 25, 2017 at 9:14 AM, Brezal Campio wrote: > For a some function which is the following: > - begin with request count at 0 > - check current request count > - if current current is less than allowed requests > - spin up a new process > - way for some given time and reset count to 0 > > This is a naive approach to rate limiting, but is there common terminology > for something like this? > > I am interested in less naive approaches to rate limiting requests as well > if anyone is willing to point in the right direction. > > Ciao! > > _______________________________________________ > 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 Thu May 25 11:48:06 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 25 May 2017 12:48:06 +0300 Subject: [erlang-questions] Terminology for Rate Limiting In-Reply-To: References: Message-ID: Hello, I believe request (bandwidth) throttling is the applicable terminology. https://en.wikipedia.org/wiki/Throttling_process_(computing) May folks are using exponential back off as less naive solution https://en.wikipedia.org/wiki/Exponential_backoff Token bucket is another approach https://en.m.wikipedia.org/wiki/Token_bucket Best Regards, Dmitry > On May 25, 2017, at 9:14 AM, Brezal Campio wrote: > > For a some function which is the following: > - begin with request count at 0 > - check current request count > - if current current is less than allowed requests > - spin up a new process > - way for some given time and reset count to 0 > > This is a naive approach to rate limiting, but is there common terminology for something like this? > > I am interested in less naive approaches to rate limiting requests as well if anyone is willing to point in the right direction. > > Ciao! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Thu May 25 14:20:38 2017 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 25 May 2017 13:20:38 +0100 Subject: [erlang-questions] enif_send backpressure Message-ID: It's my understanding that if a normal Erlang process does Pid ! Msg, and Pid has a particularly full message queue, then the sending process is penalised (gives up the remainder of its timeslice, e.g.). Is there any way to implement something similar for enif_send from a NIF? I'm calling it from a background thread in my NIF, and it'd be nice if it (e.g.) returned the size of the recipient's message queue, so that I could implement backpressure in my NIF. Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Thu May 25 14:44:42 2017 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 25 May 2017 13:44:42 +0100 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: On 25 May 2017 at 13:20, Roger Lipscombe wrote: > It's my understanding that if a normal Erlang process does Pid ! Msg, and > Pid has a particularly full message queue, then the sending process is > penalised (gives up the remainder of its timeslice, e.g.). > I found the relevant code. Search for erts_use_sender_punish in the OTP source. Is there any way to implement something similar for enif_send from a NIF? > Note that enif_send calls erts_queue_message, which *does* return the recipient's queue length (afaict). It's just that enif_send discards the result. Would a PR which implemented (e.g.) enif_send_return_len -- naming is hard, suggestions appreciated -- be considered for OTP 20.x? -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan@REDACTED Thu May 25 15:18:46 2017 From: duncan@REDACTED (duncan@REDACTED) Date: Thu, 25 May 2017 06:18:46 -0700 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 Message-ID: <20170525061846.7e43b23f706d1a78218bd3e1c66e57ee.313d881c80.wbe@email23.godaddy.com> I thought unbounded atom creation was to be avoided. If you switch to atoms, how do prevent the original concern "using atoms is just bound to fill Erlang's atom table", especially if it is driven by user data? I could foresee a hacker crashing the system by just varying lots of inputs. If the failure is limited by your architecture to just processes of that user then you can just 'let it fail'. But if filling the atom table is a wider crash than just a single user-specific server process, then it's worth thinking about avoiding. Duncan Sparrell sFractal Consulting LLC iPhone, iTypo, iApologize -------- Original Message -------- Subject: Re: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 From: Jesper Louis Andersen Date: Wed, May 24, 2017 10:57 am To: Son Tran-Nguyen Cc: "Erlang (E-mail)" On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen wrote: If any, please consider letting the develop to choose whether they want to convert the binary to atom. If the library switch itself to using atoms, then the developer cannot really do anything about it. If we make the switch, I'm pretty sure the developers won't be given a choice. The complexity of managing this will essentially mean every module in the system needs lots of small fixups. The cost/benefit analysis doesn't pan out. The impedance mismatch is when you have a field as an atom, 'created' for instance. But your object stores it as <<"created">> in a map or proplist. In this case, the code would change from execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)} to execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8), Obj, null)} which I don't think is a problem in the long run. It would help if the data is a #record{} type on the other hand. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From michal@REDACTED Thu May 25 15:28:31 2017 From: michal@REDACTED (=?utf-8?Q?Micha=C5=82_Muska=C5=82a?=) Date: Thu, 25 May 2017 15:28:31 +0200 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: <20170525061846.7e43b23f706d1a78218bd3e1c66e57ee.313d881c80.wbe@email23.godaddy.com> References: <20170525061846.7e43b23f706d1a78218bd3e1c66e57ee.313d881c80.wbe@email23.godaddy.com> Message-ID: <6fc6d7a1-0341-4440-8161-1fdbaecb41eb@Spark> There's no unbounded atom creation. Since you have the GraphQL schema, you know upfront which atoms are allowed and which aren't. You only convert those that are allowed. Micha?. On 25 May 2017, 15:19 +0200, duncan@REDACTED, wrote: > I thought unbounded atom creation was to be avoided. If you switch to > atoms, how do prevent the original concern "using atoms is just bound to > fill Erlang's atom table", especially if it is driven by user data? > I could foresee a hacker crashing the system by just varying lots of > inputs. If the failure is limited by your architecture to just > processes of that user then you can just 'let it fail'. But if filling > the atom table is a wider crash than just a single user-specific server > process, then it's worth thinking about avoiding. > > Duncan Sparrell > sFractal Consulting LLC > iPhone, iTypo, iApologize > > > > -------- Original Message -------- > Subject: Re: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 > From: Jesper Louis Andersen Date: Wed, May 24, 2017 10:57 am > To: Son Tran-Nguyen Cc: "Erlang (E-mail)" > On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen wrote: > > If any, please consider letting the develop to choose whether they want > to convert the binary to atom. If the library switch itself to using > atoms, then the developer cannot really do anything about it. > > > > > > If we make the switch, I'm pretty sure the developers won't be given a > choice. The complexity of managing this will essentially mean every > module in the system needs lots of small fixups. The cost/benefit > analysis doesn't pan out. > > > The impedance mismatch is when you have a field as an atom, 'created' > for instance. But your object stores it as <<"created">> in a map or > proplist. In this case, the code would change from > > > execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)} > > > to > > > execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8), > Obj, null)} > > > which I don't think is a problem in the long run. It would help if the > data is a #record{} type on the other hand. > > > > _______________________________________________ > 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 alex0player@REDACTED Thu May 25 18:57:20 2017 From: alex0player@REDACTED (Alex S.) Date: Thu, 25 May 2017 19:57:20 +0300 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: <59CA9CAA-C59A-4DF4-8ED4-9C339CA48D10@gmail.com> Re: name, when in doubt, just add ?_ex? suffix :) > 25 ??? 2017 ?., ? 15:44, Roger Lipscombe ???????(?): > > On 25 May 2017 at 13:20, Roger Lipscombe > wrote: > It's my understanding that if a normal Erlang process does Pid ! Msg, and Pid has a particularly full message queue, then the sending process is penalised (gives up the remainder of its timeslice, e.g.). > > I found the relevant code. Search for erts_use_sender_punish in the OTP source. > > Is there any way to implement something similar for enif_send from a NIF? > > Note that enif_send calls erts_queue_message, which *does* return the recipient's queue length (afaict). It's just that enif_send discards the result. Would a PR which implemented (e.g.) enif_send_return_len -- naming is hard, suggestions appreciated -- be considered for OTP 20.x? > > _______________________________________________ > 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 Thu May 25 19:07:48 2017 From: felixgallo@REDACTED (Felix Gallo) Date: Thu, 25 May 2017 10:07:48 -0700 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: Rather than dive into the details of another process, wouldn't it be more erlang to use enif_consume_timeslice ( http://erlang.org/doc/man/erl_nif.html#enif_consume_timeslice) and/or dirty nifs and just let the scheduler do its thing? F. On Thu, May 25, 2017 at 5:44 AM, Roger Lipscombe wrote: > On 25 May 2017 at 13:20, Roger Lipscombe wrote: > >> It's my understanding that if a normal Erlang process does Pid ! Msg, and >> Pid has a particularly full message queue, then the sending process is >> penalised (gives up the remainder of its timeslice, e.g.). >> > > I found the relevant code. Search for erts_use_sender_punish in the OTP > source. > > Is there any way to implement something similar for enif_send from a NIF? >> > > Note that enif_send calls erts_queue_message, which *does* return the > recipient's queue length (afaict). It's just that enif_send discards the > result. Would a PR which implemented (e.g.) enif_send_return_len -- naming > is hard, suggestions appreciated -- be considered for OTP 20.x? > > > _______________________________________________ > 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 Thu May 25 21:11:52 2017 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 25 May 2017 20:11:52 +0100 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: On 25 May 2017 at 18:07, Felix Gallo wrote: > Rather than dive into the details of another process, wouldn't it be more > erlang to use enif_consume_timeslice (http://erlang.org/doc/man/ > erl_nif.html#enif_consume_timeslice) and/or dirty nifs and just let the > scheduler do its thing? > This stuff's running on a background thread. Specifically, it's running a Squirrel VM (squirrel-lang.org) on a background thread. Some of the calls in the squirrel code result in enif_send to the accompanying (1:1) Erlang process. I'd like the squirrel to (briefly) pause[1] if the Erlang process has too many messages in its queue. [1] not actually pause; we're running 10s of thousands of these on a pool of background threads, we want the one that's calling enif_send too frequently to yield, *exactly* the same as an Erlang process would do. -------------- next part -------------- An HTML attachment was scrubbed... URL: From son@REDACTED Thu May 25 21:26:42 2017 From: son@REDACTED (Son Tran-Nguyen) Date: Thu, 25 May 2017 14:26:42 -0500 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: <6fc6d7a1-0341-4440-8161-1fdbaecb41eb@Spark> References: <20170525061846.7e43b23f706d1a78218bd3e1c66e57ee.313d881c80.wbe@email23.godaddy.com> <6fc6d7a1-0341-4440-8161-1fdbaecb41eb@Spark> Message-ID: There are cases when the GraphQL schema is not known at compile time. SaaS services, for example, like Graphcool, ReIndex.IO, etc..., allow the users to define their own GraphQL schema during runtime. On Thu, May 25, 2017 at 8:28 AM, Micha? Muska?a wrote: > There's no unbounded atom creation. Since you have the GraphQL schema, you > know upfront which atoms > are allowed and which aren't. You only convert those that are allowed. > > Micha?. > > On 25 May 2017, 15:19 +0200, duncan@REDACTED, wrote: > > I thought unbounded atom creation was to be avoided. If you switch to > atoms, how do prevent the original concern "using atoms is just bound to > fill Erlang's atom table", especially if it is driven by user data? > I could foresee a hacker crashing the system by just varying lots of > inputs. If the failure is limited by your architecture to just > processes of that user then you can just 'let it fail'. But if filling > the atom table is a wider crash than just a single user-specific server > process, then it's worth thinking about avoiding. > > Duncan Sparrell > sFractal Consulting LLC > iPhone, iTypo, iApologize > > > > -------- Original Message -------- > Subject: Re: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 > From: Jesper Louis Andersen Date: Wed, May 24, 2017 10:57 am > To: Son Tran-Nguyen Cc: "Erlang (E-mail)" > On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen wrote: > > If any, please consider letting the develop to choose whether they want > to convert the binary to atom. If the library switch itself to using > atoms, then the developer cannot really do anything about it. > > > > > > If we make the switch, I'm pretty sure the developers won't be given a > choice. The complexity of managing this will essentially mean every > module in the system needs lots of small fixups. The cost/benefit > analysis doesn't pan out. > > > The impedance mismatch is when you have a field as an atom, 'created' > for instance. But your object stores it as <<"created">> in a map or > proplist. In this case, the code would change from > > > execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)} > > > to > > > execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8), > Obj, null)} > > > which I don't think is a problem in the long run. It would help if the > data is a #record{} type on the other hand. > > > > _______________________________________________ > 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 felixgallo@REDACTED Thu May 25 21:53:17 2017 From: felixgallo@REDACTED (Felix Gallo) Date: Thu, 25 May 2017 12:53:17 -0700 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: If your NIF is running in a process managed by the scheduler, then as long as it uses enif_consume_timeslice appropriately, then if it sends a message to a loaded queue, it will get penalized by a large number of reductions, get deprioritized, yield, and be dropped to the bottom of the run queue, unless I'm misunderstanding. If one of the other tens of thousands of squirrels are runnable with a higher priority, they will take over the run slot. That way you wouldn't have to reach into the internals of another process to make your own determination, which seems like it'd be a better idea. But again, perhaps I'm confused. F. On Thu, May 25, 2017 at 12:11 PM, Roger Lipscombe wrote: > On 25 May 2017 at 18:07, Felix Gallo wrote: > >> Rather than dive into the details of another process, wouldn't it be more >> erlang to use enif_consume_timeslice (http://erlang.org/doc/man/erl >> _nif.html#enif_consume_timeslice) and/or dirty nifs and just let the >> scheduler do its thing? >> > > This stuff's running on a background thread. Specifically, it's running a > Squirrel VM (squirrel-lang.org) on a background thread. Some of the calls > in the squirrel code result in enif_send to the accompanying (1:1) Erlang > process. I'd like the squirrel to (briefly) pause[1] if the Erlang process > has too many messages in its queue. > > [1] not actually pause; we're running 10s of thousands of these on a pool > of background threads, we want the one that's calling enif_send too > frequently to yield, *exactly* the same as an Erlang process would do. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Thu May 25 22:09:51 2017 From: roger@REDACTED (Roger Lipscombe) Date: Thu, 25 May 2017 21:09:51 +0100 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: On 25 May 2017 at 20:53, Felix Gallo wrote: > If your NIF is running in a process managed by the scheduler, > It's not. It's running on a background thread that's unrelated to Erlang. We call enif_send from that background thread. At some point we'll look at moving the whole thing to use dirty schedulers, but that's a couple of months of work vs. what looks like about a 10 line patch. > That way you wouldn't have to reach into the internals of another process > to make your own determination, which seems like it'd be a better idea. > Given that erts_queue_message *already* returns the message queue length of the recipient, it's not exactly "reaching into the internals". -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Thu May 25 22:41:16 2017 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Thu, 25 May 2017 20:41:16 +0000 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: Could the existing implementation of enif_send() do a thread yield when sending to a congested process? The first env param will tell you if this is a created thread or process thread, so either a thread yield or sender punish could be performed. On Thu, May 25, 2017 at 7:44 AM Roger Lipscombe wrote: > On 25 May 2017 at 13:20, Roger Lipscombe wrote: > >> It's my understanding that if a normal Erlang process does Pid ! Msg, and >> Pid has a particularly full message queue, then the sending process is >> penalised (gives up the remainder of its timeslice, e.g.). >> > > I found the relevant code. Search for erts_use_sender_punish in the OTP > source. > > Is there any way to implement something similar for enif_send from a NIF? >> > > Note that enif_send calls erts_queue_message, which *does* return the > recipient's queue length (afaict). It's just that enif_send discards the > result. Would a PR which implemented (e.g.) enif_send_return_len -- naming > is hard, suggestions appreciated -- be considered for OTP 20.x? > > _______________________________________________ > 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 Thu May 25 23:41:14 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 25 May 2017 21:41:14 +0000 Subject: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 In-Reply-To: References: <20170525061846.7e43b23f706d1a78218bd3e1c66e57ee.313d881c80.wbe@email23.godaddy.com> <6fc6d7a1-0341-4440-8161-1fdbaecb41eb@Spark> Message-ID: Son, This is a good reason to keep the current state as it is. It has to be taken into consideration at least and weighed. If a user of GraphQL creates new atoms, I'm less concerned than if a random client does. But the dynamic nature is something to think about if we change this to some other representation. The current one, binaries, has served us pretty well at ShopGun, so a priori there is no reason to change this unless the atom solution gives us some kind of advantage down the road. On Thu, May 25, 2017 at 9:27 PM Son Tran-Nguyen wrote: > There are cases when the GraphQL schema is not known at compile time. > > SaaS services, for example, like Graphcool, ReIndex.IO, etc..., allow the > users to > define their own GraphQL schema during runtime. > > On Thu, May 25, 2017 at 8:28 AM, Micha? Muska?a wrote: > >> There's no unbounded atom creation. Since you have the GraphQL schema, >> you know upfront which atoms >> are allowed and which aren't. You only convert those that are allowed. >> >> Micha?. >> >> On 25 May 2017, 15:19 +0200, duncan@REDACTED, wrote: >> >> I thought unbounded atom creation was to be avoided. If you switch to >> atoms, how do prevent the original concern "using atoms is just bound to >> fill Erlang's atom table", especially if it is driven by user data? >> I could foresee a hacker crashing the system by just varying lots of >> inputs. If the failure is limited by your architecture to just >> processes of that user then you can just 'let it fail'. But if filling >> the atom table is a wider crash than just a single user-specific server >> process, then it's worth thinking about avoiding. >> >> Duncan Sparrell >> sFractal Consulting LLC >> iPhone, iTypo, iApologize >> >> >> >> -------- Original Message -------- >> Subject: Re: [erlang-questions] [ANN] GraphQL Erlang 0.8.0 >> From: Jesper Louis Andersen > Date: Wed, May 24, 2017 10:57 am >> To: Son Tran-Nguyen > Cc: "Erlang (E-mail)" > >> On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen wrote: >> >> If any, please consider letting the develop to choose whether they want >> to convert the binary to atom. If the library switch itself to using >> atoms, then the developer cannot really do anything about it. >> >> >> >> >> >> If we make the switch, I'm pretty sure the developers won't be given a >> choice. The complexity of managing this will essentially mean every >> module in the system needs lots of small fixups. The cost/benefit >> analysis doesn't pan out. >> >> >> The impedance mismatch is when you have a field as an atom, 'created' >> for instance. But your object stores it as <<"created">> in a map or >> proplist. In this case, the code would change from >> >> >> execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)} >> >> >> to >> >> >> execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8), >> Obj, null)} >> >> >> which I don't think is a problem in the long run. It would help if the >> data is a #record{} type on the other hand. >> >> >> >> _______________________________________________ >> 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 Fri May 26 08:34:00 2017 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 26 May 2017 07:34:00 +0100 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: My call to enif_send is from a non-Erlang background thread. Thread yield and sender punish don't *mean* anything. I'll be implementing the sender-punish / thread-yield in the squirrel bindings. So *I* need to know whether to do that or not -- hence returning the queue length of the recipient. On 25 May 2017 at 21:41, Daniel Goertzen wrote: > Could the existing implementation of enif_send() do a thread yield when > sending to a congested process? > > The first env param will tell you if this is a created thread or process > thread, so either a thread yield or sender punish could be performed. > > > On Thu, May 25, 2017 at 7:44 AM Roger Lipscombe > wrote: > >> On 25 May 2017 at 13:20, Roger Lipscombe wrote: >> >>> It's my understanding that if a normal Erlang process does Pid ! Msg, >>> and Pid has a particularly full message queue, then the sending process is >>> penalised (gives up the remainder of its timeslice, e.g.). >>> >> >> I found the relevant code. Search for erts_use_sender_punish in the OTP >> source. >> >> Is there any way to implement something similar for enif_send from a NIF? >>> >> >> Note that enif_send calls erts_queue_message, which *does* return the >> recipient's queue length (afaict). It's just that enif_send discards the >> result. Would a PR which implemented (e.g.) enif_send_return_len -- naming >> is hard, suggestions appreciated -- be considered for OTP 20.x? >> >> _______________________________________________ >> 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 Fri May 26 12:50:23 2017 From: z@REDACTED (Danil Zagoskin) Date: Fri, 26 May 2017 13:50:23 +0300 Subject: [erlang-questions] Terminology for Rate Limiting In-Reply-To: References: Message-ID: Hi! Some time ago I've implemented a rate limiter microservice for clustered services. It's undocumented (no time for that), but maybe you will find it useful. Rate limiter core: https://github.com/stolen/erater HTTP API for it (just in case) https://github.com/stolen/erateserver The limiting logic is located in erater_counter module. Counter behavior is configured with two options: rps and burst. Burst is how many requests are allowed just after start or after a long period of inactivity. Also there is ttl option which is used to terminate unneeded counter processes. Usage examples: 63> f(C), {ok, C} = erater_counter:start_link(none, none, [{mode, adhoc}, {rps, 0.3}, {burst, 3}, {ttl, 60000}]). {ok,<0.130.0>} 64> erater_counter:acquire(C, 0). {ok,0} 65> erater_counter:acquire(C, 0). {ok,0} 66> erater_counter:acquire(C, 0). {ok,0} 67> erater_counter:acquire(C, 0). {error,overflow} 68> erater_counter:acquire(C, 0). {error,overflow} 69> erater_counter:acquire(C, 0). {error,overflow} 70> erater_counter:acquire(C, 0). {ok,0} 71> erater_counter:acquire(C, 0). {error,overflow} The second argument of acquire is used to register future hit ? if the client wants to wait a little instead of retrying request later: 59> erater_counter:acquire(C, 5000). {ok,0} 60> erater_counter:acquire(C, 5000). {ok,1311} 61> erater_counter:acquire(C, 5000). {error,overflow} 62> erater_counter:acquire(C, 5000). {ok,2059} On Thu, May 25, 2017 at 9:14 AM, Brezal Campio wrote: > For a some function which is the following: > - begin with request count at 0 > - check current request count > - if current current is less than allowed requests > - spin up a new process > - way for some given time and reset count to 0 > > This is a naive approach to rate limiting, but is there common terminology > for something like this? > > I am interested in less naive approaches to rate limiting requests as well > if anyone is willing to point in the right direction. > > Ciao! > > _______________________________________________ > 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 max.lapshin@REDACTED Fri May 26 13:39:06 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 May 2017 14:39:06 +0300 Subject: [erlang-questions] user agent parsing. Message-ID: Hi. I have a list of 250 000 of different useragents: not only browsers, but also devices and so on. I want to get operation system, kind of device, browser and version from them, so I need user agent parser. Right now I see two of them: https://github.com/ferd/useragent https://github.com/chitika/uaparser I have checked them and they cannot parse lot of my useragent strings. What is the proper way to go here: 1) try to edit these libraries? 2) take some service with API? 3) just try to put ad-hoc hardcoded strings that will cover 90% of my records? -------------- next part -------------- An HTML attachment was scrubbed... URL: From leonard.boyce@REDACTED Fri May 26 13:53:28 2017 From: leonard.boyce@REDACTED (Leonard B) Date: Fri, 26 May 2017 07:53:28 -0400 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Hi Max, On Fri, May 26, 2017 at 7:39 AM, Max Lapshin wrote: > Hi. > > I have a list of 250 000 of different useragents: not only browsers, but > also devices and so on. > > I want to get operation system, kind of device, browser and version from > them, so I need user agent parser. > > > Right now I see two of them: > > https://github.com/ferd/useragent > https://github.com/chitika/uaparser > > I have checked them and they cannot parse lot of my useragent strings. > > What is the proper way to go here: > > 1) try to edit these libraries? > 2) take some service with API? > 3) just try to put ad-hoc hardcoded strings that will cover 90% of my > records? > We spent quite a bit of time evaluating various options and eventually just bit the bullet and brought Elixir into the mix for UA parsing. We've been using https://github.com/elixytics/ua_inspector for a few months now and find it quite solid. It's rare it does not parse things out correctly. It uses the databases from https://github.com/piwik/device-detector > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From kxepal@REDACTED Fri May 26 13:53:53 2017 From: kxepal@REDACTED (Alexander Shorin) Date: Fri, 26 May 2017 14:53:53 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Hi Max, I think you could try to make another one based on https://github.com/ua-parser It provides language agnostic set of rules to parse user agent, which updates quite frequently. We use python and scala parsers based on those and it works pretty good for us. Good thing that we can have consistent parser results across different projects. -- ,,,^..^,,, On Fri, May 26, 2017 at 2:39 PM, Max Lapshin wrote: > Hi. > > I have a list of 250 000 of different useragents: not only browsers, but > also devices and so on. > > I want to get operation system, kind of device, browser and version from > them, so I need user agent parser. > > > Right now I see two of them: > > https://github.com/ferd/useragent > https://github.com/chitika/uaparser > > I have checked them and they cannot parse lot of my useragent strings. > > What is the proper way to go here: > > 1) try to edit these libraries? > 2) take some service with API? > 3) just try to put ad-hoc hardcoded strings that will cover 90% of my > records? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From max.lapshin@REDACTED Fri May 26 13:59:17 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 May 2017 14:59:17 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: So all people are parsing it with a list of regexes? Seems that it is a problem for me, because I have such entries like HLS Client/2.0 (compatible; LG NetCast.TV-2012) or Flash MAC 10.0.32.18 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kxepal@REDACTED Fri May 26 14:02:46 2017 From: kxepal@REDACTED (Alexander Shorin) Date: Fri, 26 May 2017 15:02:46 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: I fear there is no way to do that without regular expressions since User-Agent header has no well formed structure and there could be anything. And actually people puts there anything they like. So yes, all you need is maintain list of regexps and extract with them all the bits you need. -- ,,,^..^,,, On Fri, May 26, 2017 at 2:59 PM, Max Lapshin wrote: > So all people are parsing it with a list of regexes? > > Seems that it is a problem for me, because I have such entries like HLS > Client/2.0 (compatible; LG NetCast.TV-2012) or Flash MAC 10.0.32.18 > > From essen@REDACTED Fri May 26 14:41:14 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 26 May 2017 14:41:14 +0200 Subject: [erlang-questions] erl_tracer, trace_status and pids Message-ID: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> Hello, I am optimizing an erl_tracer tracer NIF. Can you give light on the following questions? I tried to look into the source but want to double check my understanding. * trace_status is always called on enabled/3, not on enabled_*/3 * when you use enabled_*/3 and trace_*/5 functions for everything, the trace/5 function will never be called * trace_status is always called before any other enabled_*/3 so I should be fine just doing nothing in enabled_*/3, right? I'm only checking that the tracer processes are still alive anyway. Basically if you could shed light on the circumstances around trace_status that would help a lot for optimizing this. :-) Another question, I have a pool of tracer processes and want to send the events to one of them depending on the pid (all events of a pid gets to the same tracer process). Is this a valid solution? nth = (tracee.pid >> 4) % len; This gives me the number of the tracer I will send the message to. Thanks! -- Lo?c Hoguin https://ninenines.eu From donpedrothird@REDACTED Fri May 26 16:56:12 2017 From: donpedrothird@REDACTED (John Doe) Date: Fri, 26 May 2017 17:56:12 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Max, it depends on what for you do need the info from useragent. If you don't need detailed info such as model of the phone for example, you can use a fork of the useragent app, such as https://github.com/brigadier/useragent , and modify it yourself for new useragents. If you need to know detailed info, such as model of a phone or resolution, you'd need to integrate database from https://browscap.org . But as you can see, the base es very large, the full one weights about 130Mb, and naive parsing with regexps would take a lot of CPU. Often detailed version is not needed. If you sell ads buyers would be interested maybe in android or ios, or maybe even in exact version of android or ios, but not in the exact model of some obscure dumbphone. For this dumbphone the ads would cost close to zero regardless of if you show the name of the device or show 'unknown device' instead. 2017-05-26 14:39 GMT+03:00 Max Lapshin : > Hi. > > I have a list of 250 000 of different useragents: not only browsers, but > also devices and so on. > > I want to get operation system, kind of device, browser and version from > them, so I need user agent parser. > > > Right now I see two of them: > > https://github.com/ferd/useragent > https://github.com/chitika/uaparser > > I have checked them and they cannot parse lot of my useragent strings. > > What is the proper way to go here: > > 1) try to edit these libraries? > 2) take some service with API? > 3) just try to put ad-hoc hardcoded strings that will cover 90% of my > records? > > > _______________________________________________ > 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 Fri May 26 17:14:56 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 May 2017 18:14:56 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: I think that we need to know device, its vendor, os, major versions. Problem here is that it seems that I will have to fill database myself: we have stb, flash players, smart tv and so on. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trapexit@REDACTED Fri May 26 17:20:34 2017 From: trapexit@REDACTED (Antonio SJ Musumeci) Date: Fri, 26 May 2017 11:20:34 -0400 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: If the libraries don't already offer one it should be simple enough to create a cache of the literal user agent input and parsed response. While there are many permutations I'd think it's pretty fixed in practice relative to the number of possible lookups needed. On Fri, May 26, 2017 at 10:56 AM, John Doe wrote: > Max, it depends on what for you do need the info from useragent. If you > don't need detailed info such as model of the phone for example, you can > use a fork of the useragent app, such as https://github.com/brigadier/ > useragent , and modify it yourself for new useragents. > If you need to know detailed info, such as model of a phone or resolution, > you'd need to integrate database from https://browscap.org . But as you > can see, the base es very large, the full one weights about 130Mb, and > naive parsing with regexps would take a lot of CPU. > > Often detailed version is not needed. If you sell ads buyers would be > interested maybe in android or ios, or maybe even in exact version of > android or ios, but not in the exact model of some obscure dumbphone. For > this dumbphone the ads would cost close to zero regardless of if you show > the name of the device or show 'unknown device' instead. > > 2017-05-26 14:39 GMT+03:00 Max Lapshin : > >> Hi. >> >> I have a list of 250 000 of different useragents: not only browsers, but >> also devices and so on. >> >> I want to get operation system, kind of device, browser and version from >> them, so I need user agent parser. >> >> >> Right now I see two of them: >> >> https://github.com/ferd/useragent >> https://github.com/chitika/uaparser >> >> I have checked them and they cannot parse lot of my useragent strings. >> >> What is the proper way to go here: >> >> 1) try to edit these libraries? >> 2) take some service with API? >> 3) just try to put ad-hoc hardcoded strings that will cover 90% of my >> records? >> >> >> _______________________________________________ >> 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 donpedrothird@REDACTED Fri May 26 17:27:44 2017 From: donpedrothird@REDACTED (John Doe) Date: Fri, 26 May 2017 18:27:44 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Check the https://browscap.org - the csv database, it's the most complete one of the lot. I doubt you'll be able to keep the database up to date yourself. Even if you manage to gather one right now. It will become obsolete very fast. Also you can't just compare useragents "as is" with the database of useragents, as often useragents have some additional parts added by plugins, minor browser versions or even proxies, so you would need to split useragent and look up known features of known useragents in the current useragent, just to be able to detect if not all but at least some features. The browscap has such trees of features. 2017-05-26 18:14 GMT+03:00 Max Lapshin : > I think that we need to know device, its vendor, os, major versions. > > Problem here is that it seems that I will have to fill database myself: we > have stb, flash players, smart tv and so on. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthonym@REDACTED Fri May 26 19:45:49 2017 From: anthonym@REDACTED (Anthony Molinaro) Date: Fri, 26 May 2017 10:45:49 -0700 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: This library should do what you want https://github.com/zotonic/ua_classifier We've been using it in production for some time (maybe 5-6 years). Every so often you need to update the database (which is now Apache DeviceMap IIRC). Hope that helps, -Anthony > On May 26, 2017, at 8:27 AM, John Doe wrote: > > Check the https://browscap.org - the csv database, it's the most complete one of the lot. I doubt you'll be able to keep the database up to date yourself. Even if you manage to gather one right now. It will become obsolete very fast. > > Also you can't just compare useragents "as is" with the database of useragents, as often useragents have some additional parts added by plugins, minor browser versions or even proxies, so you would need to split useragent and look up known features of known useragents in the current useragent, just to be able to detect if not all but at least some features. The browscap has such trees of features. > > 2017-05-26 18:14 GMT+03:00 Max Lapshin : >> I think that we need to know device, its vendor, os, major versions. >> >> Problem here is that it seems that I will have to fill database myself: we have stb, flash players, smart tv and so on. >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Fri May 26 20:56:48 2017 From: marc@REDACTED (Marc Worrell) Date: Fri, 26 May 2017 20:56:48 +0200 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Nice to hear that you are using our library! If you happen to have database updates, then you are very welcome to make merge requests. - Marc > On 26 May 2017, at 19:45, Anthony Molinaro wrote: > > This library should do what you want > > https://github.com/zotonic/ua_classifier > > We've been using it in production for some time (maybe 5-6 years). Every so often you need to update the database (which is now Apache DeviceMap IIRC). > > Hope that helps, > > -Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Sat May 27 00:25:42 2017 From: donpedrothird@REDACTED (John Doe) Date: Sat, 27 May 2017 01:25:42 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: Unfortunately Apache Devicemap is retired, in other words it is no more. There will be no updates. 2017-05-26 21:56 GMT+03:00 Marc Worrell : > Nice to hear that you are using our library! > If you happen to have database updates, then you are very welcome to make > merge requests. > > - Marc > > > On 26 May 2017, at 19:45, Anthony Molinaro > wrote: > > This library should do what you want > > https://github.com/zotonic/ua_classifier > > We've been using it in production for some time (maybe 5-6 years). Every > so often you need to update the database (which is now Apache DeviceMap > IIRC). > > Hope that helps, > > -Anthony > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Oliver.Korpilla@REDACTED Sat May 27 13:17:02 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Sat, 27 May 2017 13:17:02 +0200 Subject: [erlang-questions] Problem with vm.args app env Message-ID: Hello, I have a vm.args file and I try to do the following: -my_app config name-of-config.xml where my_app is indeed the name of the application. But I get: {"init terminating in do_boot",{error,'Bad environment variable: "name-of-config.xml" Application: my_app'}} I get this also if I write: -my_app config 'name-of-config.xml' -my_app config "name-of-config.xml" I just want to pass a few configuration parameters in but it does not seem to work. Thank you, Oliver From jesper.louis.andersen@REDACTED Sat May 27 16:08:25 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 27 May 2017 14:08:25 +0000 Subject: [erlang-questions] Problem with vm.args app env In-Reply-To: References: Message-ID: You are trying to use `name-of-config.sml` as an erlang term. It isn't valid because it is not a valid erlang term since it has a . in it. You can wrap it in quotes to make it a string. Do note that variable expansion in the shell may affect you, so we wrap it in single quotes to avoid variable expansion inside. Example: [jlouis@REDACTED ~]$ erl -kernel config '"name-of-config.xml"' Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.0 (abort with ^G) 1> application:get_env(kernel, config). {ok,"name-of-config.xml"} On Sat, May 27, 2017 at 1:17 PM Oliver Korpilla wrote: > Hello, > > I have a vm.args file and I try to do the following: > > -my_app config name-of-config.xml > > where my_app is indeed the name of the application. > > But I get: > > {"init terminating in do_boot",{error,'Bad environment variable: > "name-of-config.xml" Application: my_app'}} > > I get this also if I write: > > -my_app config 'name-of-config.xml' > -my_app config "name-of-config.xml" > > I just want to pass a few configuration parameters in but it does not seem > to work. > > Thank you, > Oliver > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Oliver.Korpilla@REDACTED Sat May 27 16:19:57 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Sat, 27 May 2017 16:19:57 +0200 Subject: [erlang-questions] Problem with vm.args app env In-Reply-To: References: Message-ID: Thank you, Jesper. I wasn't aware such '" "' quoting was necessary in an vm.args file. It solved my problem! Again, thanks! Oliver ? Gesendet:?Samstag, 27. Mai 2017 um 16:08 Uhr Von:?"Jesper Louis Andersen" An:?"Oliver Korpilla" , erlang-questions@REDACTED Betreff:?Re: [erlang-questions] Problem with vm.args app env You are trying to use `name-of-config.sml` as an erlang term. It isn't valid because it is not a valid erlang term since it has a . in it. You can wrap it in quotes to make it a string. Do note that variable expansion in the shell may affect you, so we wrap it in single quotes to avoid variable expansion inside. Example: ? [jlouis@REDACTED ~]$ erl -kernel config '"name-of-config.xml"' Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] ? Eshell V9.0 ?(abort with ^G) 1> application:get_env(kernel, config). {ok,"name-of-config.xml"} ?? On Sat, May 27, 2017 at 1:17 PM Oliver Korpilla wrote:Hello, I have a vm.args file and I try to do the following: -my_app config name-of-config.xml where my_app is indeed the name of the application. But I get: {"init terminating in do_boot",{error,'Bad environment variable: "name-of-config.xml"? Application: my_app'}} I get this also if I write: -my_app config 'name-of-config.xml' -my_app config "name-of-config.xml" I just want to pass a few configuration parameters in but it does not seem to work. Thank you, Oliver _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED[mailto:erlang-questions@REDACTED] http://erlang.org/mailman/listinfo/erlang-questions From khitai.pang@REDACTED Sat May 27 17:31:47 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 15:31:47 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs Message-ID: I have observed a situation where the port process exits with reason 'einval' but the external program still runs. The connected process of the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port process exit with 'einval' while the external program still runs? Thanks Khitai From khitai.pang@REDACTED Sat May 27 17:42:59 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 15:42:59 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: Message-ID: The port is opened with {packet, 2}, I'm guessing that the data sent to the port is too big and it's size can't fit in a two-byte integer. Thanks Khitai On 2017/5/27 23:31, Khitai Pang wrote: > I have observed a situation where the port process exits with reason > 'einval' but the external program still runs. The connected process of > the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port > process exit with 'einval' while the external program still runs? > > > Thanks > Khitai > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From khitai.pang@REDACTED Sat May 27 17:57:59 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 15:57:59 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: Message-ID: No it can't be the case, port_command will return error and the data will not be sent to the port. This is really weird, this erlang app has been running for a month and millions and millions of messages have been processed by the ports, and this is first time I see port process exit with einval and external prog still runs. Thanks Khitai On 2017/5/27 23:42, Khitai Pang wrote: > The port is opened with {packet, 2}, I'm guessing that the data sent to > the port is too big and it's size can't fit in a two-byte integer. > > Thanks > Khitai > > On 2017/5/27 23:31, Khitai Pang wrote: >> I have observed a situation where the port process exits with reason >> 'einval' but the external program still runs. The connected process of >> the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port >> process exit with 'einval' while the external program still runs? >> >> >> Thanks >> Khitai >> _______________________________________________ >> 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 mjtruog@REDACTED Sat May 27 18:06:24 2017 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 27 May 2017 09:06:24 -0700 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: Message-ID: <5929A400.9060204@gmail.com> On 2017/5/27 23:31, Khitai Pang wrote: >> I have observed a situation where the port process exits with reason >> 'einval' but the external program still runs. The connected process of >> the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port >> process exit with 'einval' while the external program still runs? Normally that is due to the port source code not handling a HUP on the output file descriptor, from poll (POLLHUP) or the equivalent using a different function. Best Regards, Michael From khitai.pang@REDACTED Sat May 27 18:21:28 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 16:21:28 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: <5929A400.9060204@gmail.com> References: <5929A400.9060204@gmail.com> Message-ID: On 2017/5/28 00:06, Michael Truog wrote: On 2017/5/27 23:31, Khitai Pang wrote: I have observed a situation where the port process exits with reason 'einval' but the external program still runs. The connected process of the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port process exit with 'einval' while the external program still runs? Normally that is due to the port source code Do you mean the source code of the external program? not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. Could you be more specific about this situation? In what occasions will this happen? My external program is a python script that uses erlport to communicate with erlang. Thanks Khitai Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat May 27 19:45:12 2017 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 27 May 2017 10:45:12 -0700 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: <5929A400.9060204@gmail.com> Message-ID: <5929BB28.5010008@gmail.com> On 05/27/2017 09:21 AM, Khitai Pang wrote: > On 2017/5/28 00:06, Michael Truog wrote: >> >> On 2017/5/27 23:31, Khitai Pang wrote: >>>> I have observed a situation where the port process exits with reason >>>> 'einval' but the external program still runs. The connected process of >>>> the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port >>>> process exit with 'einval' while the external program still runs? >> >> Normally that is due to the port source code > > Do you mean the source code of the external program? Yes > >> not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. > > Could you be more specific about this situation? In what occasions will this happen? > > My external program is a python script that uses erlport to communicate with erlang. erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From khitai.pang@REDACTED Sat May 27 21:06:50 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 19:06:50 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: <5929BB28.5010008@gmail.com> References: <5929A400.9060204@gmail.com> <5929BB28.5010008@gmail.com> Message-ID: On 2017/5/28 01:45, Michael Truog wrote: On 05/27/2017 09:21 AM, Khitai Pang wrote: On 2017/5/28 00:06, Michael Truog wrote: On 2017/5/27 23:31, Khitai Pang wrote: I have observed a situation where the port process exits with reason 'einval' but the external program still runs. The connected process of the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port process exit with 'einval' while the external program still runs? Normally that is due to the port source code Do you mean the source code of the external program? Yes not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. Could you be more specific about this situation? In what occasions will this happen? My external program is a python script that uses erlport to communicate with erlang. erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. Thank you for your explanation, but I don't really understand, if the cause is that the Erlang VM certainly disappeared, how come the connected process got the {EXIT,#Port<0....>,einval} message? Anyway, what to do to avoid this issue? Thanks Khitai Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat May 27 21:28:26 2017 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 27 May 2017 12:28:26 -0700 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: <5929A400.9060204@gmail.com> <5929BB28.5010008@gmail.com> Message-ID: <5929D35A.5000704@gmail.com> On 05/27/2017 12:06 PM, Khitai Pang wrote: > On 2017/5/28 01:45, Michael Truog wrote: >> On 05/27/2017 09:21 AM, Khitai Pang wrote: >>> On 2017/5/28 00:06, Michael Truog wrote: >>>> >>>> On 2017/5/27 23:31, Khitai Pang wrote: >>>>>> I have observed a situation where the port process exits with reason >>>>>> 'einval' but the external program still runs. The connected process of >>>>>> the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port >>>>>> process exit with 'einval' while the external program still runs? >>>> >>>> Normally that is due to the port source code >>> >>> Do you mean the source code of the external program? >> >> Yes >> >>> >>>> not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. >>> >>> Could you be more specific about this situation? In what occasions will this happen? >>> >>> My external program is a python script that uses erlport to communicate with erlang. >> >> erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. > > Thank you for your explanation, but I don't really understand, if the cause is that the Erlang VM certainly disappeared, how come the connected process got the {EXIT,#Port<0....>,einval} message? That message is the Erlang message inside the Erlang VM related to the Erlang port type used for the pipes that were used for the erlport executable. So, that means the Erlang port type died with a posix einval error, but that doesn't mean that the erlport executable is aware of a problem. It is possible the error is only seen by the Erlang VM if the erlport has no reason to call the write function, mentioned above. > > Anyway, what to do to avoid this issue? Not sure, it may require changing erlport or taking a different approach. To avoid the problem, you could attempt to always make the erlport executable exit by executing "sys.exit(0)" or something similar, but that isn't dependable when you are unable to send erlport something to exit (i.e., if a sudden error makes the Erlang port type unusable in the Erlang VM, as appears to have happened here). Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From khitai.pang@REDACTED Sat May 27 22:35:46 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sat, 27 May 2017 20:35:46 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: <5929D35A.5000704@gmail.com> References: <5929A400.9060204@gmail.com> <5929BB28.5010008@gmail.com> <5929D35A.5000704@gmail.com> Message-ID: On 2017/5/28 03:28, Michael Truog wrote: On 05/27/2017 12:06 PM, Khitai Pang wrote: On 2017/5/28 01:45, Michael Truog wrote: On 05/27/2017 09:21 AM, Khitai Pang wrote: On 2017/5/28 00:06, Michael Truog wrote: On 2017/5/27 23:31, Khitai Pang wrote: I have observed a situation where the port process exits with reason 'einval' but the external program still runs. The connected process of the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port process exit with 'einval' while the external program still runs? Normally that is due to the port source code Do you mean the source code of the external program? Yes not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. Could you be more specific about this situation? In what occasions will this happen? My external program is a python script that uses erlport to communicate with erlang. erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. Thank you for your explanation, but I don't really understand, if the cause is that the Erlang VM certainly disappeared, how come the connected process got the {EXIT,#Port<0....>,einval} message? That message is the Erlang message inside the Erlang VM related to the Erlang port type used for the pipes that were used for the erlport executable. So, that means the Erlang port type died with a posix einval error, but that doesn't mean that the erlport executable is aware of a problem. It is possible the error is only seen by the Erlang VM if the erlport has no reason to call the write function, mentioned above. Hi Michael, OK I see what you mean, the external program process doesn't know that its Erlang port process has exited, because it hasn't written anything to the output file descriptor after that. I think you are right about this. Anyway, what to do to avoid this issue? Not sure, it may require changing erlport or taking a different approach. To avoid the problem, you could attempt to always make the erlport executable exit by executing "sys.exit(0)" or something similar, but that isn't dependable when you are unable to send erlport something to exit (i.e., if a sudden error makes the Erlang port type unusable in the Erlang VM, as appears to have happened here). When the Erlang port process is gone, I don't think the Erlang VM can send anything to the external program process. However, I think we still have a way to kill the external program process: after creating a port, use erlang:port_info(Port, os_pid) to get the OS pid of the external program process and save it somewhere, e.g. in gen_server state. When the Erlang port process dies, kill the external program process by its OS pid. I haven't tested it, though. Actually, in my case, it's not a serious problem that the external program process is not aware of the exiting of its Erlang port process and keeps running after that. What I'm really concerned with is why the Erlang port process died with einval error, this is a serious problem and I need to find a way to fix it. Any idea? Thanks Khitai Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sun May 28 00:00:22 2017 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 27 May 2017 15:00:22 -0700 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: References: <5929A400.9060204@gmail.com> <5929BB28.5010008@gmail.com> <5929D35A.5000704@gmail.com> Message-ID: <5929F6F6.3080400@gmail.com> On 05/27/2017 01:35 PM, Khitai Pang wrote: > On 2017/5/28 03:28, Michael Truog wrote: >> On 05/27/2017 12:06 PM, Khitai Pang wrote: >>> On 2017/5/28 01:45, Michael Truog wrote: >>>> On 05/27/2017 09:21 AM, Khitai Pang wrote: >>>>> On 2017/5/28 00:06, Michael Truog wrote: >>>>>> >>>>>> On 2017/5/27 23:31, Khitai Pang wrote: >>>>>>>> I have observed a situation where the port process exits with reason >>>>>>>> 'einval' but the external program still runs. The connected process of >>>>>>>> the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port >>>>>>>> process exit with 'einval' while the external program still runs? >>>>>> >>>>>> Normally that is due to the port source code >>>>> >>>>> Do you mean the source code of the external program? >>>> >>>> Yes >>>> >>>>> >>>>>> not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. >>>>> >>>>> Could you be more specific about this situation? In what occasions will this happen? >>>>> >>>>> My external program is a python script that uses erlport to communicate with erlang. >>>> >>>> erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. >>> >>> Thank you for your explanation, but I don't really understand, if the cause is that the Erlang VM certainly disappeared, how come the connected process got the {EXIT,#Port<0....>,einval} message? >> That message is the Erlang message inside the Erlang VM related to the Erlang port type used for the pipes that were used for the erlport executable. So, that means the Erlang port type died with a posix einval error, but that doesn't mean that the erlport executable is aware of a problem. It is possible the error is only seen by the Erlang VM if the erlport has no reason to call the write function, mentioned above. > > Hi Michael, > > OK I see what you mean, the external program process doesn't know that its Erlang port process has exited, because it hasn't written anything to the output file descriptor after that. I think you are right about this. > >>> Anyway, what to do to avoid this issue? >> Not sure, it may require changing erlport or taking a different approach. To avoid the problem, you could attempt to always make the erlport executable exit by executing "sys.exit(0)" or something similar, but that isn't dependable when you are unable to send erlport something to exit (i.e., if a sudden error makes the Erlang port type unusable in the Erlang VM, as appears to have happened here). > > When the Erlang port process is gone, I don't think the Erlang VM can send anything to the external program process. However, I think we still have a way to kill the external program process: after creating a port, use erlang:port_info(Port, os_pid) to get the OS pid of the external program process and save it somewhere, e.g. in gen_server state. When the Erlang port process dies, kill the external program process by its OS pid. I haven't tested it, though. > > Actually, in my case, it's not a serious problem that the external program process is not aware of the exiting of its Erlang port process and keeps running after that. What I'm really concerned with is why the Erlang port process died with einval error, this is a serious problem and I need to find a way to fix it. Any idea? Based on http://erlang.org/doc/man/erlang.html#open_port-2 documentation "einval if no POSIX code is appropriate", einval is not the normal POSIX error from exec. If the port executable is still running, then perhaps it unintentionally closed the pipes the Erlang VM is trying to use (since that doesn't appear to be mentioned in any of the other POSIX errors). That may have happened after a python exception possibly, but this is something you would need to explore. Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From khitai.pang@REDACTED Sun May 28 18:21:27 2017 From: khitai.pang@REDACTED (Khitai Pang) Date: Sun, 28 May 2017 16:21:27 +0000 Subject: [erlang-questions] Port process exits with status einval while external program still runs In-Reply-To: <5929F6F6.3080400@gmail.com> References: <5929A400.9060204@gmail.com> <5929BB28.5010008@gmail.com> <5929D35A.5000704@gmail.com> <5929F6F6.3080400@gmail.com> Message-ID: On 2017/5/28 06:00, Michael Truog wrote: On 05/27/2017 01:35 PM, Khitai Pang wrote: On 2017/5/28 03:28, Michael Truog wrote: On 05/27/2017 12:06 PM, Khitai Pang wrote: On 2017/5/28 01:45, Michael Truog wrote: On 05/27/2017 09:21 AM, Khitai Pang wrote: On 2017/5/28 00:06, Michael Truog wrote: On 2017/5/27 23:31, Khitai Pang wrote: I have observed a situation where the port process exits with reason 'einval' but the external program still runs. The connected process of the port receives {EXIT,#Port<0.3069817>,einval}. What makes a port process exit with 'einval' while the external program still runs? Normally that is due to the port source code Do you mean the source code of the external program? Yes not handling a HUP on the output file descriptor,from poll (POLLHUP) or the equivalent using a different function. Could you be more specific about this situation? In what occasions will this happen? My external program is a python script that uses erlport to communicate with erlang. erlport should be getting EPIPE in the source code https://github.com/hdima/erlport/blob/master/priv/python2/erlport/erlproto.py#L106-L110 . However, that depends on the write function getting called to discover the Erlang VM disappeared. Thank you for your explanation, but I don't really understand, if the cause is that the Erlang VM certainly disappeared, how come the connected process got the {EXIT,#Port<0....>,einval} message? That message is the Erlang message inside the Erlang VM related to the Erlang port type used for the pipes that were used for the erlport executable. So, that means the Erlang port type died with a posix einval error, but that doesn't mean that the erlport executable is aware of a problem. It is possible the error is only seen by the Erlang VM if the erlport has no reason to call the write function, mentioned above. Hi Michael, OK I see what you mean, the external program process doesn't know that its Erlang port process has exited, because it hasn't written anything to the output file descriptor after that. I think you are right about this. Anyway, what to do to avoid this issue? Not sure, it may require changing erlport or taking a different approach. To avoid the problem, you could attempt to always make the erlport executable exit by executing "sys.exit(0)" or something similar, but that isn't dependable when you are unable to send erlport something to exit (i.e., if a sudden error makes the Erlang port type unusable in the Erlang VM, as appears to have happened here). When the Erlang port process is gone, I don't think the Erlang VM can send anything to the external program process. However, I think we still have a way to kill the external program process: after creating a port, use erlang:port_info(Port, os_pid) to get the OS pid of the external program process and save it somewhere, e.g. in gen_server state. When the Erlang port process dies, kill the external program process by its OS pid. I haven't tested it, though. Actually, in my case, it's not a serious problem that the external program process is not aware of the exiting of its Erlang port process and keeps running after that. What I'm really concerned with is why the Erlang port process died with einval error, this is a serious problem and I need to find a way to fix it. Any idea? Based on http://erlang.org/doc/man/erlang.html#open_port-2 documentation "einval if no POSIX code is appropriate", einval is not the normal POSIX error from exec. If the port executable is still running, then perhaps it unintentionally closed the pipes the Erlang VM is trying to use (since that doesn't appear to be mentioned in any of the other POSIX errors). That may have happened after a python exception possibly, but this is something you would need to explore. I also doubt that the external program (python script using erlport-0.6) did something funny and confused the port process, but no error/exception was caught in the external program log, and the issue can't be reproduced now. Anyway, I'll keep looking into it. Thanks! Best Regards, Khitai Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon May 29 13:26:57 2017 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 29 May 2017 13:26:57 +0200 Subject: [erlang-questions] erl_tracer, trace_status and pids In-Reply-To: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> References: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> Message-ID: Hello, On Fri, May 26, 2017 at 2:41 PM, Lo?c Hoguin wrote: > > * trace_status is always called on enabled/3, not on enabled_*/3 > yes > * when you use enabled_*/3 and trace_*/5 functions for everything, the > trace/5 function will never be called > hmm, that should be true in the current implementation. That may change in the future though. > * trace_status is always called before any other enabled_*/3 so I should > be fine just doing nothing in enabled_*/3, right? I'm only checking that > the tracer processes are still alive anyway. no, trace_status is not always called before enabled_*. The only event that I know of where it is called is enabled_call/3, there may be a couple of more but not all of them. > Basically if you could shed light on the circumstances around trace_status > that would help a lot for optimizing this. :-) > the check for trace_status call is made in various places in the vm code where the VM finds it convenient to do a check and see if the tracer is still alive. There are no specific rules about when it is called. Another question, I have a pool of tracer processes and want to send the > events to one of them depending on the pid (all events of a pid gets to the > same tracer process). Is this a valid solution? > > nth = (tracee.pid >> 4) % len; > > This gives me the number of the tracer I will send the message to. > It is one way to do it, but you are relying on the internal representation of a PID, which may change, and I don't think you get a very good hash. In OTP-20 there is a new nif called enif_hash/3 that can be used to get a better hash value. ( http://erlang.org/documentation/doc-9.0-rc1/erts-9.0/doc/html/erl_nif.html#enif_hash ) Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon May 29 14:13:58 2017 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 29 May 2017 14:13:58 +0200 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: Hello, On Thu, May 25, 2017 at 2:20 PM, Roger Lipscombe wrote: > Is there any way to implement something similar for enif_send from a NIF? > It is possible to get that information in the current implementation, but it may very well not be possible in future implementations. We don't want to create an API that exposes an implementation detail that may very well change in the future. If you need that type of back pressure, you should implement your own synchronization mechanism. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue May 30 00:06:37 2017 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 29 May 2017 23:06:37 +0100 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: On 29 May 2017 at 13:13, Lukas Larsson wrote: > It is possible to get that information in the current implementation, but > it may very well not be possible in future implementations. We don't want > to create an API that exposes an implementation detail that may very well > change in the future. > That's fair. > If you need that type of back pressure, you should implement your own > synchronization mechanism. > Any suggestions for things I should take a look at? Thanks, Roger. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Tue May 30 01:07:56 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 30 May 2017 11:07:56 +1200 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: > On 27/05/2017, at 3:14 AM, Max Lapshin wrote: > > I think that we need to know device, its vendor, os, major versions. I have no idea how much of a problem it is these days, but user agents used to lie a lot. Indeed, one of the browsers I use still has an easy-to-use option to say what it should pretend to be. From daniel.goertzen@REDACTED Tue May 30 03:36:06 2017 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Tue, 30 May 2017 01:36:06 +0000 Subject: [erlang-questions] enif_send backpressure In-Reply-To: References: Message-ID: When you send a message to the process you could increment a counter, and when the process finishes it can call a NIF to decrement the counter. Resources might be handy if you have many counters to keep track of. On Mon, May 29, 2017 at 5:06 PM Roger Lipscombe wrote: > On 29 May 2017 at 13:13, Lukas Larsson wrote: > >> It is possible to get that information in the current implementation, but >> it may very well not be possible in future implementations. We don't want >> to create an API that exposes an implementation detail that may very well >> change in the future. >> > > That's fair. > > >> If you need that type of back pressure, you should implement your own >> synchronization mechanism. >> > > Any suggestions for things I should take a look at? > > Thanks, > Roger. > > _______________________________________________ > 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 Tue May 30 10:14:27 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 30 May 2017 10:14:27 +0200 Subject: [erlang-questions] erl_tracer, trace_status and pids In-Reply-To: References: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> Message-ID: <7ba88142-1ab4-9505-7b32-b6b4ddb23237@ninenines.eu> Thanks for the replies! On 05/29/2017 01:26 PM, Lukas Larsson wrote: > * when you use enabled_*/3 and trace_*/5 functions for everything, > the trace/5 function will never be called > > hmm, that should be true in the current implementation. That may change > in the future though. I'll change it in the future then. :-) > * trace_status is always called before any other enabled_*/3 so I > should be fine just doing nothing in enabled_*/3, right? I'm only > checking that the tracer processes are still alive anyway. > > > no, trace_status is not always called before enabled_*. The only event > that I know of where it is called is enabled_call/3, there may be a > couple of more but not all of them. Alright. I'm a bit confused still. Would it make sense to only perform some checks for trace_status, for example checking that the tracer process exists? Then for other enabled_*/3 calls I would just reject events I don't need. > Basically if you could shed light on the circumstances around > trace_status that would help a lot for optimizing this. :-) > > > the check for trace_status call is made in various places in the vm code > where the VM finds it convenient to do a check and see if the tracer is > still alive. There are no specific rules about when it is called. It sounds like the answer to my question is a yes. :-) > Another question, I have a pool of tracer processes and want to send > the events to one of them depending on the pid (all events of a pid > gets to the same tracer process). Is this a valid solution? > > nth = (tracee.pid >> 4) % len; > > This gives me the number of the tracer I will send the message to. > > > It is one way to do it, but you are relying on the internal > representation of a PID, which may change, and I don't think you get a > very good hash. > > In OTP-20 there is a new nif called enif_hash/3 that can be used to get > a better hash value. > (http://erlang.org/documentation/doc-9.0-rc1/erts-9.0/doc/html/erl_nif.html#enif_hash) Thanks, I will use it on OTP 20+ then. -- Lo?c Hoguin https://ninenines.eu From gattushivakrishna@REDACTED Tue May 30 07:52:53 2017 From: gattushivakrishna@REDACTED (Gattu shiva krishna) Date: Tue, 30 May 2017 11:22:53 +0530 Subject: [erlang-questions] Erlang Long Node Creation Message-ID: Hi all, In my application there is a requirement to have two erlang long nodes with different IP addresses(I've two ethernet interfaces in my PC). The queries I've are: 1. Is it possible to create a different erlang long node(with different IP address) from the existing(already running) erlang node? If so what is the best way of doing it? Since os:cmd/1 function failed with the message "*** Terminating erlang" Regards, Gattu shivakrishna. From essen@REDACTED Tue May 30 11:40:31 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 30 May 2017 11:40:31 +0200 Subject: [erlang-questions] erl_tracer, trace_status and pids In-Reply-To: <7ba88142-1ab4-9505-7b32-b6b4ddb23237@ninenines.eu> References: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> <7ba88142-1ab4-9505-7b32-b6b4ddb23237@ninenines.eu> Message-ID: <409f0044-ac87-2bcd-5995-fb4fa9fd1415@ninenines.eu> On 05/30/2017 10:14 AM, Lo?c Hoguin wrote: >> * trace_status is always called before any other enabled_*/3 so I >> should be fine just doing nothing in enabled_*/3, right? I'm only >> checking that the tracer processes are still alive anyway. >> >> >> no, trace_status is not always called before enabled_*. The only event >> that I know of where it is called is enabled_call/3, there may be a >> couple of more but not all of them. > > Alright. I'm a bit confused still. Would it make sense to only perform > some checks for trace_status, for example checking that the tracer > process exists? Then for other enabled_*/3 calls I would just reject > events I don't need. > >> Basically if you could shed light on the circumstances around >> trace_status that would help a lot for optimizing this. :-) >> >> >> the check for trace_status call is made in various places in the vm >> code where the VM finds it convenient to do a check and see if the >> tracer is still alive. There are no specific rules about when it is >> called. > > It sounds like the answer to my question is a yes. :-) Answering myself. I think what I was looking for can be found in this sentence of the documentation: "It is called in multiple scenarios, but most significantly it is used when tracing is started using this tracer." If correct, then this means trace_status is always called at least once before anything happens; and that's good enough for me. That would allow me to remove traces for the tracer processes immediately when receiving the trace_status, and not have to worry about that in enabled_*/3 calls. Cheers, -- Lo?c Hoguin https://ninenines.eu From Oliver.Korpilla@REDACTED Tue May 30 12:53:02 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Tue, 30 May 2017 12:53:02 +0200 Subject: [erlang-questions] Erlang Long Node Creation In-Reply-To: References: Message-ID: Hello, Gattu. You could for example use the slave API. IIRC it has a few caveats like setting the code loading paths for the slave, but in principle you can start additional erlang nodes this way. I have an example lying around here somewhere, line looked like this: slave:start(net_adm:localhost(), name , '-pa #{string:join(code:get_path, ' -pa ') }') Excuse any mistakes, the example was actually in elixir calling into Erlang. I hope it still provides some pointers. I just tried to adapt the syntax... not sure about correct quoting here. Regards, Oliver ? ? Gesendet:?Dienstag, 30. Mai 2017 um 07:52 Uhr Von:?"Gattu shiva krishna" An:?erlang-questions@REDACTED Betreff:?[erlang-questions] Erlang Long Node Creation Hi all, In my application there is a requirement to have two erlang long nodes with different IP addresses(I've two ethernet interfaces in my PC). The queries I've are: 1. Is it possible to create a different erlang long node(with different IP address) from the existing(already running) erlang node? If so what is the best way of doing it? Since os:cmd/1 function failed with the message "*** Terminating erlang" Regards, Gattu shivakrishna. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From mbike2000ru@REDACTED Tue May 30 13:19:38 2017 From: mbike2000ru@REDACTED (Dmitry) Date: Tue, 30 May 2017 11:19:38 +0000 (UTC) Subject: [erlang-questions] A question on sys:trace References: <1332126116.2431119.1496143178884.ref@mail.yahoo.com> Message-ID: <1332126116.2431119.1496143178884@mail.yahoo.com> Hello My application has a name - ws. When I tried to trace calls it gives me exeptiion error sys:trace(ws,true).** exception exit: {noproc,{sys,trace,[ws,true]}} Why does such an error occur? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mohammedmazharuddin@REDACTED Tue May 30 10:46:54 2017 From: mohammedmazharuddin@REDACTED (Mohammed mazhar uddin) Date: Tue, 30 May 2017 14:16:54 +0530 Subject: [erlang-questions] Installation package for wxerlang project Message-ID: <77cb23f0-ecb2-49fe-ebf9-5d345e85cf42@utl.in> Hi all, How can i create installation package for wxerlang project? Please revert with complete procedure for creating installation package. Thank you, Mohammed Mazhar Uddin. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Tue May 30 15:05:36 2017 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 30 May 2017 15:05:36 +0200 Subject: [erlang-questions] erl_tracer, trace_status and pids In-Reply-To: <409f0044-ac87-2bcd-5995-fb4fa9fd1415@ninenines.eu> References: <7322daa8-b453-6428-66ff-9933b03c9913@ninenines.eu> <7ba88142-1ab4-9505-7b32-b6b4ddb23237@ninenines.eu> <409f0044-ac87-2bcd-5995-fb4fa9fd1415@ninenines.eu> Message-ID: On Tue, May 30, 2017 at 11:40 AM, Lo?c Hoguin wrote: > On 05/30/2017 10:14 AM, Lo?c Hoguin wrote: > >> * trace_status is always called before any other enabled_*/3 so I >>> should be fine just doing nothing in enabled_*/3, right? I'm only >>> checking that the tracer processes are still alive anyway. >>> >>> >>> no, trace_status is not always called before enabled_*. The only event >>> that I know of where it is called is enabled_call/3, there may be a couple >>> of more but not all of them. >>> >> >> Alright. I'm a bit confused still. Would it make sense to only perform >> some checks for trace_status, for example checking that the tracer process >> exists? Then for other enabled_*/3 calls I would just reject events I don't >> need. >> >> Basically if you could shed light on the circumstances around >>> trace_status that would help a lot for optimizing this. :-) >>> >>> >>> the check for trace_status call is made in various places in the vm code >>> where the VM finds it convenient to do a check and see if the tracer is >>> still alive. There are no specific rules about when it is called. >>> >> >> It sounds like the answer to my question is a yes. :-) >> > > Answering myself. > > I think what I was looking for can be found in this sentence of the > documentation: > > "It is called in multiple scenarios, but most significantly it is used > when tracing is started using this tracer." > > If correct, then this means trace_status is always called at least once > before anything happens; and that's good enough for me. That would allow me > to remove traces for the tracer processes immediately when receiving the > trace_status, and not have to worry about that in enabled_*/3 calls. > It is not overly clear/correct in the docs. One purpose of trace_status was that it and only it should be able to remove tracers from the tracee. There are assertions in the code that prohibit trace nifs from returning 'remove' from any event other then trace_status. However, those are only triggered in debug builds. The current non-debug code and to some extent docs seems to allow enabled_*/3 calls to also remove tracers from tracees. Writing clear and concise documentation is hard. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Tue May 30 16:45:41 2017 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 30 May 2017 15:45:41 +0100 Subject: [erlang-questions] int:find_src/2, shell:try_source/2 ignore the obvious place to find source files? Message-ID: When compiling some Erlang source files with mix, I discovered that it leaves out the abstract_code chunk. This means that rr(Mod) -- implemented in shell:read_file_records/2 -- falls through to shell:try_source/2, which looks in the "CInf" chunk. It then uses the 'options'.'outdir' value and attempts to recreate the source path from that. That is: given the following: [{options, [{outdir, "/home/roger/Source/foo/bar/_build/dev/lib/baz/ebin"}, {i,"include"}]}, {version,"7.0.4"}, {source,"/home/roger/Source/foo/bar/baz/src/quux.erl"}] ...it'll look for "/home/roger/Source/foo/bar/_build/dev/lib/baz/ebin/quux.erl" and "/home/roger/Source/foo/bar/_build/dev/lib/baz/src/quux.erl", which don't exist. int:find_src/2 does the same. It seems to me that the correct behaviour would be to use the 'source' property, if present...? -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas@REDACTED Tue May 30 16:34:44 2017 From: thomas@REDACTED (Thomas Lange) Date: Tue, 30 May 2017 16:34:44 +0200 Subject: [erlang-questions] Can't update xterm title bar from Erlang In-Reply-To: References: Message-ID: Hi Roger, I can see two issues here. Firstly, "\a" does not seem to be supported by erlang. \a is supposed to translate to BEL, i.e. ASCII 7. It's not: ---- Eshell V8.2.1 (abort with ^G) 1> A = "\a". "a" 2> length(A). 1 3> hd(A). 97 ---- Secondly, writing BEL to stdout does not seem to work either. It seems to be internally replaced with "^G": --------------- Eshell V8.2.1 (abort with ^G) 1> io:put_chars("\007"). ^Gok 2> io:put_chars([7]). ^Gok 3> ---- And this is from the strace of commands above: ---- [pid 28365] writev(0, [{iov_base="^G", iov_len=2}], 1) = 2 [pid 28365] writev(0, [{iov_base="^G", iov_len=2}], 1) = 2 ----- I suspect this could have something to do with ^G (BEL) being the shell abort command. I have successfully tried a workaround using a port opened with nouse_stdio flag: xterm_title(T) -> S = "\e]0;" ++ T ++ "\007", open_port({spawn, "echo -ne \"" ++ S ++ "\""}, [nouse_stdio]), ok. /Thomas On May 15 13:17:41 CEST 2017, Roger Lipscombe wrote: > I don't need the line feed from the shell: > > echo -ne '\e]0;Hello\a' ; sleep 5 > > ...works fine. > > But, in terms of line-feed-flushes-buffers, maybe. > > Except that I immediately output something else with a line feed, and the > terminal (gnome-terminal, Linux Mint) shows *something* for the escape > sequence. It looks almost-correct, but it's hard to tell. > > I suspect something to do with how Erlang has configured the tty for > (maybe) raw mode, but I don't understand enough about how that works. > > On 15 May 2017 at 11:17, Alex S. <> wrote: > >> What I?ve noticed is you don?t output the line feed, which might mean that >> the IO buffer isn?t getting flushed by default. Although I am not sure. >> >> 12 ??? 2017 ?., ? 22:28, Roger Lipscombe <> >> ???????(?): >> >> I have the following: >> >> put_progress(Format, Args) -> >> io:put_chars(user, >> [tsl(), io_lib:format(Format, Args), fsl()]), >> io:put_chars(user, >> [colored(), io_lib:format(Format, Args), reset(), >> "\n"]), >> ok. >> >> tsl() -> "\e]0;". >> fsl() -> "\a". >> colored() -> "\e[1;44m". >> reset() -> "\e[0m". >> >> That is: output the same message to the title bar (tsl, fsl are the tput >> capability names; see https://serverfault.com/a/23998/7027), and then >> (for now) also output it in colour, so that I can see if it's being called >> correctly. >> >> Unfortunately, something is messing with my tsl() and fsl() escape codes. >> The coloured text is coming out correctly, but the other stuff's garbage. >> The escape codes are correct; I've tested them at the bash prompt with >> "echo -e '\e]0;Hello\a'". >> >> So... what's screwing with them when they're output from ct_run? >> >> Interestingly, if I try the same at the Erlang prompt, it hangs the shell >> until I press Ctrl+C twice, at which point the text is output, but still >> messed up. >> From gordeev.vladimir.v@REDACTED Tue May 30 18:57:23 2017 From: gordeev.vladimir.v@REDACTED (Vladimir Gordeev) Date: Tue, 30 May 2017 19:57:23 +0300 Subject: [erlang-questions] Use several file server processes Message-ID: Greetings, I want to start separate erlang shell processes (via shell:start/2) on my erlang node. I want each of these shells to have their own CWD, that could be read/written by file:get_cwd/0, file:set_cwd/1. I hoped to find something like that: http://erlang.org/doc/apps/stdlib/io_protocol.html but for file operations. I looked up in stdlib file.erl and discovered that it makes gen_server:call to process registered under file_server_2, which is hardcoded in source. There is not way to achieve what I want? -------------- next part -------------- An HTML attachment was scrubbed... URL: From gordeev.vladimir.v@REDACTED Tue May 30 20:25:02 2017 From: gordeev.vladimir.v@REDACTED (Vladimir Gordeev) Date: Tue, 30 May 2017 21:25:02 +0300 Subject: [erlang-questions] Use several file server processes In-Reply-To: References: Message-ID: I had an idea to use slave nodes expecting them so start their own independent file server, but turns out it relays to master-node file server: http://erlang.org/doc/man/slave.html#start-1 On Tue, May 30, 2017 at 7:57 PM, Vladimir Gordeev < gordeev.vladimir.v@REDACTED> wrote: > Greetings, > > I want to start separate erlang shell processes (via shell:start/2) on my > erlang node. I want each of these shells to have their own CWD, that could > be read/written by file:get_cwd/0, file:set_cwd/1. > > I hoped to find something like that: http://erlang.org/doc/ > apps/stdlib/io_protocol.html but for file operations. > > I looked up in stdlib file.erl and discovered that it makes > gen_server:call to process registered under file_server_2, which is > hardcoded in source. > > There is not way to achieve what I want? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pfisher@REDACTED Tue May 30 21:03:17 2017 From: pfisher@REDACTED (Fisher, Paul) Date: Tue, 30 May 2017 19:03:17 +0000 Subject: [erlang-questions] Use several file server processes In-Reply-To: References: , Message-ID: Use prim_file and create separate ports for each process you want to run fileops in parallel. We have a fileops module that just creates ports and stuff it into the process dictionary to reused, which works out well, since lifecycle of the ports works with the lifetime of the process. This works around the file_server_2 bottleneck. These two functions should give you the idea: read_file(Name) -> Port = get_port(), prim_file:read_file( Port, Name ). get_port() -> case get( ?MODULE ) of undefined -> Port = case prim_file:start() of {ok, Port0} -> Port0; {error, Reason} -> exit( {?MODULE, failed_to_create_prim_file, Reason} ) end, put( ?MODULE, Port ), Port; Port -> Port end. -- paul Fellow, Engineering ________________________________ From: erlang-questions-bounces@REDACTED on behalf of Vladimir Gordeev Sent: Tuesday, May 30, 2017 1:25:02 PM To: erlang-questions@REDACTED Subject: Re: [erlang-questions] Use several file server processes I had an idea to use slave nodes expecting them so start their own independent file server, but turns out it relays to master-node file server: http://erlang.org/doc/man/slave.html#start-1 On Tue, May 30, 2017 at 7:57 PM, Vladimir Gordeev > wrote: Greetings, I want to start separate erlang shell processes (via shell:start/2) on my erlang node. I want each of these shells to have their own CWD, that could be read/written by file:get_cwd/0, file:set_cwd/1. I hoped to find something like that: http://erlang.org/doc/apps/stdlib/io_protocol.html but for file operations. I looked up in stdlib file.erl and discovered that it makes gen_server:call to process registered under file_server_2, which is hardcoded in source. There is not way to achieve what I want? Confidentiality Notice | This email and any included attachments may be privileged, confidential and/or otherwise protected from disclosure. Access to this email by anyone other than the intended recipient is unauthorized. If you believe you have received this email in error, please contact the sender immediately and delete all copies. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lankeanandrao@REDACTED Wed May 31 09:51:29 2017 From: lankeanandrao@REDACTED (lankeanandrao) Date: Wed, 31 May 2017 13:21:29 +0530 Subject: [erlang-questions] How many async threads can be spawned in dual core system ? Message-ID: Hi all, I want to know, How many maximum number of async threads can be spawned for dual core processor. Thanks & Regards, Anand Rao L. From zxq9@REDACTED Wed May 31 10:21:34 2017 From: zxq9@REDACTED (zxq9) Date: Wed, 31 May 2017 17:21:34 +0900 Subject: [erlang-questions] How many async threads can be spawned in dual core system ? In-Reply-To: References: Message-ID: <2548195.kf14XJvHaW@changa> On 2017?05?31? ??? 13:21:29 lankeanandrao wrote: > I want to know, How many maximum number of async threads can be > spawned for dual core processor. As many as the other aspects of your system can handle. "Other aspects" meaning: memory, your Erlang runtime's settings, etc. "Threads" are a poor way of thinking about this. Erlang processes are Erlang processes. Generally speaking, that is the level of abstraction you should be concerned with, not "threads" which is a different level of abstraction entirely (by every common definition of "thread"). The Erlang runtime will by default spawn a "scheduler" per thing that appears in your operating system as a "core" (an actual CPU core, or a "hyperthread", a virtualized core, or whatever). These schedulers are OS-level threads and work together to share the work of your Erlang processes among them. Within the Erlang runtime, though, you spawn as many processes as you want, and the schedulers take care of making sure they each get a "fair" amount of execution time among them. I am generalizing a lot, but basically you don't think about things in terms of "how many cores do I have and how many threads does that let me use..." and so on. That is quite low-level. Erlang abstracts that away -- which is one of the powerful reasons for using it when you are trying to write a low-latency, highly concurrent system that experienced graceful performance degradation under load. If you are unfamiliar with the "concurrency-oriented programming" paradigm present in Erlang (similr to "the actor model", though different for a number of nit-picky academic reasons) this may be helpful to skim through: https://stackoverflow.com/questions/32294367/erlang-process-vs-java-thread -Craig From laan.sachin@REDACTED Wed May 31 10:10:19 2017 From: laan.sachin@REDACTED (Alex Anto Navis Lawrence) Date: Wed, 31 May 2017 16:10:19 +0800 Subject: [erlang-questions] Reg: SNMP v3 not working with AES Message-ID: Hello friends, I have been trying to make the SNMP v3 work with AES, but couldn't. Please find the code in the below gist. Erlang/OTP 19 Elixir: 1.4.2 https://gist.github.com/alexnavis/8eec113cabc47a43a5a6d1eb870352fb *Problem:* SNMP packet is sent out but there is no response from the server. Code gist has the working Net-SNMP shell utility working command. It fails in the receive block timeout since no packet is received (I verified with wireshark). The same code works if it is the DES algorithm. *Code:* >From the erlang code for AES, it uses Local EngineBoots and EngineTime to create the IV. SaltFun() is a incremental value which is sent as part of the authorizationParameters in the UDP headers. I feel using local engineBoots and engineTime might be wrong since the remote agent will not have any idea about our snmp_manager boots and engine time. Any thoughts on this ? snmp_usm.erl. aes_encrypt(PrivKey, Data, SaltFun, EngineBoots, EngineTime) -> AesKey = PrivKey, Salt = SaltFun(), IV = list_to_binary([?i32(EngineBoots), ?i32(EngineTime) | Salt]), EncData = crypto:block_encrypt(?BLOCK_CIPHER_AES, AesKey, IV, Data), {ok, binary_to_list(EncData), Salt}. Any pointers will be really helpful. Thanks. -- Thanks, Alex Anto Navis. L -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Wed May 31 12:30:02 2017 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 31 May 2017 11:30:02 +0100 Subject: [erlang-questions] int:find_src/2, shell:try_source/2 ignore the obvious place to find source files? In-Reply-To: References: Message-ID: Some clarifications... On 30 May 2017 at 15:45, Roger Lipscombe wrote: > When compiling some Erlang source files with mix, I discovered that it > leaves out the abstract_code chunk. > or: ...when compiling some Erlang source files with mix, with custom erlc_options that omit :debug_info, it leaves out the abstract_code chunk. or: ...when compiling Erlang source files without 'debug_info', when the output directory isn't just 'src' replaced with 'ebin' (i.e. rebar3 or mix behaviour...). > This means that rr(Mod) -- implemented in shell:read_file_records/2 -- > falls through to shell:try_source/2, which looks in the "CInf" chunk. It > then uses the 'options'.'outdir' value and attempts to recreate the source > path from that. > > That is: given the following: > ...result from Baz:module_info(compile)... > [{options, [{outdir, "/home/roger/Source/foo/bar/_ > build/dev/lib/baz/ebin"}, > {i,"include"}]}, > {version,"7.0.4"}, > {source,"/home/roger/Source/foo/bar/baz/src/quux.erl"}] > (or, equivalently, the "CInf" chunk) ...it'll look for "/home/roger/Source/foo/bar/_build/dev/lib/baz/ebin/quux.erl" > and "/home/roger/Source/foo/bar/_build/dev/lib/baz/src/quux.erl", which > don't exist. > > int:find_src/2 does the same. > > It seems to me that the correct behaviour would be to use the 'source' > property, if present...? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v@REDACTED Wed May 31 13:17:43 2017 From: v@REDACTED (Valentin Micic) Date: Wed, 31 May 2017 13:17:43 +0200 Subject: [erlang-questions] How many async threads can be spawned in dual core system ? In-Reply-To: <2548195.kf14XJvHaW@changa> References: <2548195.kf14XJvHaW@changa> Message-ID: <06344ED2-5BF3-43F9-B78C-92C50127B338@pharos-avantgard.com> One time I've deployed a ridiculous systems using highly fragmented disk-only (dets) mnesia tables, and I started close to 1000 threads -- which roughly corresponded to a number of fragments in the schema. The system worked. CAVEAT EMPTOR: once I had a power failure and all those dets files required repair. I've restarted the system using the same number of threads, but it ran out of memory as each threads during the repair somehow utilized more memory. I've never quite understood why, but fixed it by reducing a number of thread during the repair, and then restarted the system with the same amount of threads without any further problems. V/ On 31 May 2017, at 10:21 AM, zxq9 wrote: > On 2017?05?31? ??? 13:21:29 lankeanandrao wrote: >> I want to know, How many maximum number of async threads can be >> spawned for dual core processor. > > As many as the other aspects of your system can handle. > "Other aspects" meaning: memory, your Erlang runtime's settings, etc. > > "Threads" are a poor way of thinking about this. Erlang processes are Erlang processes. Generally speaking, that is the level of abstraction you should be concerned with, not "threads" which is a different level of abstraction entirely (by every common definition of "thread"). > > The Erlang runtime will by default spawn a "scheduler" per thing that appears in your operating system as a "core" (an actual CPU core, or a "hyperthread", a virtualized core, or whatever). These schedulers are OS-level threads and work together to share the work of your Erlang processes among them. Within the Erlang runtime, though, you spawn as many processes as you want, and the schedulers take care of making sure they each get a "fair" amount of execution time among them. > > I am generalizing a lot, but basically you don't think about things in terms of "how many cores do I have and how many threads does that let me use..." and so on. That is quite low-level. Erlang abstracts that away -- which is one of the powerful reasons for using it when you are trying to write a low-latency, highly concurrent system that experienced graceful performance degradation under load. > > If you are unfamiliar with the "concurrency-oriented programming" paradigm present in Erlang (similr to "the actor model", though different for a number of nit-picky academic reasons) this may be helpful to skim through: > https://stackoverflow.com/questions/32294367/erlang-process-vs-java-thread > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From dominik_pawlak@REDACTED Wed May 31 13:41:16 2017 From: dominik_pawlak@REDACTED (Dominik Pawlak) Date: Wed, 31 May 2017 13:41:16 +0200 Subject: [erlang-questions] Reg: SNMP v3 not working with AES In-Reply-To: References: Message-ID: <7c0d8e07-8662-017b-d1a5-c962022f585d@yahoo.co.uk> Hello Alex, This looks similar to: http://erlang.org/pipermail/erlang-questions/2016-September/090132.html Basically, there was a bug for AES encryption in snmp library (exactly what you are pointing in your mail). You can fix it by applying a patch that is attached in the above post. Best, Dominik Pawlak On 31.05.2017 10:10, Alex Anto Navis Lawrence wrote: > Hello friends, > > I have been trying to make the SNMP v3 work with AES, but couldn't. > Please find the code in the below gist. > > Erlang/OTP 19 > Elixir: 1.4.2 > > https://gist.github.com/alexnavis/8eec113cabc47a43a5a6d1eb870352fb > > > *Problem:* > SNMP packet is sent out but there is no response from the server. Code > gist has the working Net-SNMP shell utility working command. > It fails in the receive block timeout since no packet is received (I > verified with wireshark). The same code works if it is the DES algorithm. > > *Code:* > > From the erlang code for AES, it uses Local EngineBoots and EngineTime > to create the IV. SaltFun() is a incremental value which is sent as > part of the authorizationParameters in the UDP headers. I feel using > local engineBoots and engineTime might be wrong since the remote agent > will not have any idea about our snmp_manager boots and engine time. > Any thoughts on this ? > > |snmp_usm.erl. aes_encrypt(PrivKey, Data, SaltFun, EngineBoots, > EngineTime) -> AesKey = PrivKey, Salt = SaltFun(), IV = > list_to_binary([?i32(EngineBoots), ?i32(EngineTime) | Salt]), EncData > = crypto:block_encrypt(?BLOCK_CIPHER_AES, AesKey, IV, Data), {ok, > binary_to_list(EncData), Salt}.| > > Any pointers will be really helpful. Thanks. > > > -- > Thanks, > Alex Anto Navis. L > > > _______________________________________________ > 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 Wed May 31 17:38:51 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 31 May 2017 18:38:51 +0300 Subject: [erlang-questions] user agent parsing. In-Reply-To: References: Message-ID: We do not need to make a 100% or even 90% detection of user identity, we need to show: who was watching. Right now I have stopped with taking uaparser library and I've added extra list with specific streaming clients. -------------- next part -------------- An HTML attachment was scrubbed... URL: From laan.sachin@REDACTED Wed May 31 18:42:06 2017 From: laan.sachin@REDACTED (Alex Anto Navis Lawrence) Date: Thu, 1 Jun 2017 00:42:06 +0800 Subject: [erlang-questions] Reg: SNMP v3 not working with AES In-Reply-To: <7c0d8e07-8662-017b-d1a5-c962022f585d@yahoo.co.uk> References: <7c0d8e07-8662-017b-d1a5-c962022f585d@yahoo.co.uk> Message-ID: Hi Dominik, Thanks a lot for the help. I was on the same line of fix based on RFC-3826 (3.1.2.1. AES Encryption Key and IV) where I got the response and got stuck with decryption problem. Now I saw the patch and applied the remaining changes(git ) on decryption got the whole thing workings. Thanks a lot for your help, you saved a lot for me. ?? Any idea on this why this is not fixed in latest erlang code. ?. Can i be any help to make this to raise for a PR for the same. ? Thanks, Alex On Wed, May 31, 2017 at 7:41 PM, Dominik Pawlak wrote: > Hello Alex, > This looks similar to: > http://erlang.org/pipermail/erlang-questions/2016-September/090132.html > > Basically, there was a bug for AES encryption in snmp library (exactly > what you are pointing in your mail). You can fix it by applying a patch > that is attached in the above post. > > Best, > Dominik Pawlak > > > On 31.05.2017 10:10, Alex Anto Navis Lawrence wrote: > > Hello friends, > > I have been trying to make the SNMP v3 work with AES, but couldn't. Please > find the code in the below gist. > > Erlang/OTP 19 > Elixir: 1.4.2 > > https://gist.github.com/alexnavis/8eec113cabc47a43a5a6d1eb870352fb > > *Problem:* > SNMP packet is sent out but there is no response from the server. Code > gist has the working Net-SNMP shell utility working command. > It fails in the receive block timeout since no packet is received (I > verified with wireshark). The same code works if it is the DES algorithm. > > *Code:* > > From the erlang code for AES, it uses Local EngineBoots and EngineTime to > create the IV. SaltFun() is a incremental value which is sent as part of > the authorizationParameters in the UDP headers. I feel using local > engineBoots and engineTime might be wrong since the remote agent will not > have any idea about our snmp_manager boots and engine time. Any thoughts on > this ? > > snmp_usm.erl. > aes_encrypt(PrivKey, Data, SaltFun, EngineBoots, EngineTime) -> > AesKey = PrivKey, > Salt = SaltFun(), > IV = list_to_binary([?i32(EngineBoots), ?i32(EngineTime) | Salt]), > EncData = crypto:block_encrypt(?BLOCK_CIPHER_AES, > AesKey, IV, Data), > {ok, binary_to_list(EncData), Salt}. > > Any pointers will be really helpful. Thanks. > > > -- > Thanks, > Alex Anto Navis. L > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > -- Thanks, Alex Anto Navis. L -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Wed May 31 20:16:59 2017 From: kenneth@REDACTED (Kenneth Lundin) Date: Wed, 31 May 2017 20:16:59 +0200 Subject: [erlang-questions] Erlang/OTP 20.0-rc2 is available for testing Message-ID: OTP 20 Release Candidate 2 This is the second of two release candidates before the OTP 20 release. The intention with this release is that you as users try it and give us feedback if something does not work as expected. Could be a bug, an unexpected incompatibility, a significant change of characteristics in negative direction, etc. There are only minor changes compared to the first release candidate, some of them listed below: - erts: ./configure --enable-lock-counter will enable building of an additional emulator that has support for lock counting. (The option previously existed, but would turn on lock counting in the default emulator being built.) To start the lock-counting emulator, use erl -emu_type lcnt . - kernel: Added the process_flag message_queue_data = off_heap to the code_server process in order to improve characteristics during code upgrade, which can generate a huge amount of messages. Here are some of the most important news in OTP 20 (same as in RC1): Potential Incompatibilities - ERTS: - The non SMP Erlang VM is deprecated and not built by default - Remove deprecated erlang:hash/2 - erlang:statistics/1 with scheduler_wall_time now also includes info about dirty CPU schedulers. - The new purge strategy introduced in OTP 19.1 is mandatory and slightly incompatible for processes holding funs see erlang:check_process_code/3. - The NIF library reload is not supported anymore. - Asn1: Deprecated module and functions removed (asn1rt, asn1ct:encode/3 and decode/3) - Ssh: client only option in a call to start a daemon will now fail Highlights Erts: - Dirty schedulers enabled and supported on VM with SMP support. - support for ?dirty? BIFs and ?dirty? GC. - erlang:garbage_collect/2 for control of minor or major GC - Erlang literals are no longer copied when sending messages. - Improved performance for large ETS tables, >256 entries (except ordered_set) - erlang:system_info/1 atom_count and atom_limit - Reduced memory pressure by converting sub-binaries to heap-binaries during GC - enif_select, map an external event to message Compiler: - Code generation for complicated guards is improved. - Warnings for repeated identical map keys. #{'a'=>1, 'b'=>2, 'a'=>3} will warn for the repeated key a. - By default there is now a warning when export_all is used. Can be disabled - Pattern matching for maps is optimized - New option deterministic to omit path to source + options info the BEAM file. - Atoms may now contain arbitrary unicode characters. - compile:file/2 has an option to include extra chunks in the BEAM file. Misc other applications - Unnamed ets tables optimized - A new event manager to handle a subset of OS signals in Erlang - Optimized sets add_element, del_element and union - Added rand:jump/0-1 - When a gen_server crashes, the stacktrace for the client will be printed to facilitate debugging. - take/2 has been added to dict, orddict, and gb_trees. - take_any/2 has been added to gb_trees - Significantly updated string module with unicode support - erl_tar support for long path names and new file formats - Dtls: Documented API, experimental - SSH: improving security, removing and adding algorithms - New math:fmod/2 For more details see http://erlang.org/download/otp_src_20.0-rc2.readme Pre built versions for Windows can be fetched here: http://erlang.org/download/otp_win32_20.0-rc2.exe http://erlang.org/download/otp_win64_20.0-rc2.exe On line documentation can be browsed here: www.erlang.org/documentation/doc-9.0-rc2/doc/ Thanks to all contributors. /The Erlang/OTP team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Wed May 31 20:33:11 2017 From: kenneth@REDACTED (Kenneth Lundin) Date: Wed, 31 May 2017 20:33:11 +0200 Subject: [erlang-questions] Erlang/OTP 20.0-rc1 is available for testing In-Reply-To: <590CE447.4030603@gmail.com> References: <590CE447.4030603@gmail.com> Message-ID: On Fri, May 5, 2017 at 10:44 PM, Michael Truog wrote: > It seems good to point out a change that may surprise people that have > scripts that depend on the old process name "beam.smp" which now changes to > the script name, or is set by an environment variable > We have changed the default name back to beam.smp when started via erl. It caused problems for several users. /Kenneth , Erlang/OTP team Ericsson. > > OTP-14381 Application(s): erts > > Changed erts startup program name, argv 0, to use the > environment variable ESCRIPT_NAME so that erlc, > dialyzer, typer, ct_run, or the escript name can be > seen with external programs, such as ps and htop > (depending on options), on unix. > > If environment variable ESCRIPT_NAME is not set, argv 0 > of the invoking program will be used, e.g. the name > will be erl, cerl, or the soft link name. > > > This is a great change, but one to be aware of. > > Best Regards, > Michael > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: