From hakan.stenholm@REDACTED Wed Jun 1 01:36:33 2005 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Wed, 01 Jun 2005 01:36:33 +0200 Subject: gs context menu In-Reply-To: <429C38E7.60907@redstarling.com> References: <429C38E7.60907@redstarling.com> Message-ID: <429CF501.9070605@mbox304.swipnet.se> ke.han wrote: > Hello, > I am looking to build a new erlang tool and would like to know if the > gs menu object can be used as a pop-up (context menu) for example from > a list or an edit control. > thanks, Jon > I don't think you can, I at least can't find any options that would place a 'menu button' anywhere else than in the window menu. You'll probably have to use something like a 'listbox' or use a button (or other control) to open a separate selection window (which then acts like a context menu). It may be possible to implement a context menu (visible inside - but not outside the window) by drawing it in a 'canvas', 'frame' or similar element that is then raised above all other gui elements (use the config-only 'raise' option). From serge@REDACTED Wed Jun 1 03:22:16 2005 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 31 May 2005 21:22:16 -0400 Subject: linked-in driver Message-ID: <429D0DC8.5040403@hq.idt.net> I need to pass parameters to the start function of a linked-in driver, but I am not sure how this can be done. The start function accepts a char* command. Is there a way to pass anything there besides the driver's name? int start(ErlDrvPort port, char* command); After examining erlang:open_port/2 I found the {env, Environment} option, but I believe it only works for port drivers. Any advice on the subject is appreciated. Regards, Serge From spearce@REDACTED Wed Jun 1 05:03:18 2005 From: spearce@REDACTED (Shawn Pearce) Date: Tue, 31 May 2005 23:03:18 -0400 Subject: linked-in driver In-Reply-To: <429D0DC8.5040403@hq.idt.net> References: <429D0DC8.5040403@hq.idt.net> Message-ID: <20050601030317.GA14639@spearce.org> Serge Aleynikov wrote: > I need to pass parameters to the start function of a linked-in driver, > but I am not sure how this can be done. > > The start function accepts a char* command. Is there a way to pass > anything there besides the driver's name? > > int start(ErlDrvPort port, char* command); > > After examining erlang:open_port/2 I found the {env, Environment} > option, but I believe it only works for port drivers. > > Any advice on the subject is appreciated. Pass the parameters as part of the driver string to open_port. E.g. erlang:open_port("mydrv param1 param2", ...) will give you the string "mydrv param1 param2" in the command parameter of the start function in your C code. You will have to parse out the parameters on your own. I believe the only requirement on the format of this string is that the characters leading up to the first ASCII space match the name of the driver; the rest is left up to the driver. -- Shawn. From casper2000a@REDACTED Wed Jun 1 08:57:39 2005 From: casper2000a@REDACTED (Casper) Date: Wed, 1 Jun 2005 12:57:39 +0600 Subject: Network recovery Message-ID: Hi All, When a network communication failure occurs, do nodes disconnect? How can they re-connect when the network comes back online? In the application startup I use net_adm:world_list(WorldList) to connect to all the needed nodes. Since the network recovery doesn't give any triggers, application doesn't know when the recovery happens. Do I need to periodically run world_list to get that done or is there a better way? Thanks, - Eranga -------------- next part -------------- An HTML attachment was scrubbed... URL: From ft@REDACTED Wed Jun 1 11:08:15 2005 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 1 Jun 2005 11:08:15 +0200 Subject: distributed Erlang connect fails In-Reply-To: References: <200505301539.29284.ft@it.su.se> Message-ID: <200506011108.16201.ft@it.su.se> On Tuesday 31 May 2005 16.47, Gerd Flaig wrote: > Fredrik Thulin writes: > > I'm writing a command-line control tool for my application. I get > > into problems if I execute my control-tool rapidly (like pressing > > up-arrow and then enter in the UNIX shell). > > you could try to assign a unique name to each control tool instance, > like in > > $ erl -name control$$ -hidden -remsh incomingproxy@`hostname -f` Yes, sure. I think this is a bigger problem though. I have seen this problem many times before, when I stop one of my nodes and want to restart it immediately. I've given the question about what really is the problem some more thought, and I think the problem is that the node that continues running is not made aware of the other node stopping. Sometimes, this seems to go fairly quick (so restart works), but sometimes it seems to take the full 75 seconds (comment in dist_util.erl : "The detection time interval is thus, by default, 45s < DT < 75s") of not receiving an answer to ticks sent to the other node before the running node discovers that the other node is gone. With a seven second timeout for the node starting up, this obviously has a (great) possibility to fail. /Fredrik From thomasl_erlang@REDACTED Wed Jun 1 15:24:33 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 1 Jun 2005 06:24:33 -0700 (PDT) Subject: debug tips? In-Reply-To: <429C3D41.6080207@redstarling.com> Message-ID: <20050601132433.61733.qmail@web41901.mail.yahoo.com> --- "ke.han" wrote: > I feel like there must have been a better way to > close in on the error > than what I did. For example, is there a way to get > a report when > another process "throws" an error. You can monitor other processes with the trace BIF and the dbg module, though I can't say whether it helps in this case. > What if I have > no idea, as in this > case, how the error was generated..the "error" tuple > was simply passed > back to the Client process. Any suggestions? I'd like more informative exceptions too. I tend to use my smart_exceptions package (see Jungerl) as a compiler prepass. This adds module, line number, etc. to the exception ... but that only helps for code you have compiled yourself, and, since R10, causes masses of (useless) warnings from the compiler to boot. The real solution would be to extend the runtime system, though. http://www.erlang.org/ml-archive/erlang-questions/200310/msg00237.html (Adding some nice way to categorize exceptions would be useful too. Inheritance, anyone? :-) Best, Thomas __________________________________ Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html From ulf.wiger@REDACTED Wed Jun 1 16:31:55 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 1 Jun 2005 16:31:55 +0200 Subject: debug tips? Message-ID: > I spent about two hours last night debugging a call into mnesia. I > finally found my error but it took a very long time to > step..step..step > through many lines before I found exactly what triggered the > mnesia:abort(). > The call into mnesia was: > mnesia:create_table/2 > The problem of course is the return result was simply: > {aborted,{bad_type,iserve_callback,disc_copies,'jon1@REDACTED'}} The return result tells you that some input argument(s) had were of the wrong type: (foobey@REDACTED)18> mnesia:error_description(v(16)). {"Bad type on some provided arguments", iserve_callback, {disc_copies,foobey@REDACTED}} The option that was badly typed was disc_copies, and its value was (in your case) 'jon1@REDACTED', when it should have been a list of nodes. Granted, it is easy to overlook this the first dozen or so times reading the mnesia manual. (: > No stack trace...just a return from the shell process. > By putting a breakpoint in mnesia_schema and stepping through > for a very > long time, I was finally able to catch the code which called > mnesia:abort(). (There are many places in mnesia_schema where the > mnesia:abort() is called). You can also do this (see below). It produces a lot of output, but can be quite useful in finding out where an error occurs. BR, Uffe (foobey@REDACTED)12> dbg:tracer(). {ok,<0.100.0>} (foobey@REDACTED)13> dbg:tpl(mnesia_schema,'_','_',[{'_',[],[{message,{return_trace}}]}]). {ok,[{matched,foobey@REDACTED,233},{saved,1}]} (foobey@REDACTED)14> dbg:p(all,[c]). {ok,[{matched,foobey@REDACTED,59}]} (foobey@REDACTED)16> mnesia:create_table(iserve_callback,[{disc_copies,node()}]). (<0.44.0>) call mnesia_schema:create_table([{name,iserve_callback},{disc_copies,foobey@REDACTED}]) (<0.44.0>) call mnesia_schema:schema_transaction(#Fun) ... (<0.108.0>) call mnesia_schema:verify({alt,[nil,list]},nil,{bad_type,iserve_callback,{ram_copies,[]}}) (<0.108.0>) call mnesia_schema:do_verify({alt,[nil,list]},nil,{bad_type,iserve_callback,{ram_copies,[]}}) (<0.108.0>) returned from mnesia_schema:do_verify/3 -> ok (<0.108.0>) returned from mnesia_schema:verify/3 -> ok (<0.108.0>) call mnesia_schema:verify({alt,[nil,list]},atom,{bad_type,iserve_callback,{disc_copies,foobey@REDACTED}}) (<0.108.0>) call mnesia_schema:do_verify({alt,[nil,list]},atom,{bad_type,iserve_callback,{disc_copies,foobey@REDACTED}}) (<0.44.0>) returned from mnesia_schema:schema_transaction/1 -> {aborted, {bad_type, iserve_callback, {disc_copies, foobey@REDACTED}}} (<0.44.0>) returned from mnesia_schema:create_table/1 -> {aborted, {bad_type, iserve_callback, {disc_copies, foobey@REDACTED}}} From tty@REDACTED Wed Jun 1 16:41:41 2005 From: tty@REDACTED (tty@REDACTED) Date: Wed, 1 Jun 2005 10:41:41 -0400 Subject: Erlang socket client Message-ID: Hello, Thank you for your reply. Here is a sample screen shot of both sessions. ==================== Telnet session ======== telnet 172.20.22.180 7777 Trying 172.20.22.180... Connected to 172.20.22.180. Escape character is '^]'. ati ati Nokia OK ^]q telnet> q ==================== Telnet session ======== I tried two different gen_tcp:connect. The first example mclient:client uses {active, true}. The second example uses {active, false}. Both connect uses 'binary', {packet, 0}. mclient:mclient does two gen_tcp:recv with a timeout of 6000. ==================== Erl session ======== Erlang (BEAM) emulator version 5.4.4 [source] [hipe] Eshell V5.4.4 (abort with ^G) 1> mclient:client("ati"). ati ok 2> mclient:mclient("ati"). some stuff0 ati Error timeout ok 3> ==================== Erl session ======== The code used is included. Thanks again. Tee -------------- next part -------------- A non-text attachment was scrubbed... Name: mclient.erl Type: application/octet-stream Size: 1184 bytes Desc: not available URL: From serge@REDACTED Wed Jun 1 16:59:29 2005 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 01 Jun 2005 10:59:29 -0400 Subject: linked-in driver In-Reply-To: <20050601030317.GA14639@spearce.org> References: <429D0DC8.5040403@hq.idt.net> <20050601030317.GA14639@spearce.org> Message-ID: <429DCD51.90801@hq.idt.net> Thanks Shawn! I'd like to add a little note that this also works fine with erlang:open_port({spawn, "mydrv param1 param2"}, ...) Shawn Pearce wrote: > Serge Aleynikov wrote: > >>I need to pass parameters to the start function of a linked-in driver, >>but I am not sure how this can be done. >> >>The start function accepts a char* command. Is there a way to pass >>anything there besides the driver's name? >> >>int start(ErlDrvPort port, char* command); >> >>After examining erlang:open_port/2 I found the {env, Environment} >>option, but I believe it only works for port drivers. >> >>Any advice on the subject is appreciated. > > > > Pass the parameters as part of the driver string to open_port. E.g. > > erlang:open_port("mydrv param1 param2", ...) > > will give you the string "mydrv param1 param2" in the command parameter > of the start function in your C code. You will have to parse out the > parameters on your own. I believe the only requirement on the format > of this string is that the characters leading up to the first ASCII > space match the name of the driver; the rest is left up to the driver. From klacke@REDACTED Wed Jun 1 18:19:03 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Wed, 1 Jun 2005 18:19:03 +0200 Subject: Erlang socket client In-Reply-To: References: Message-ID: <20050601161903.GA20230@hyber.org> On Wed, Jun 01, 2005 at 10:41:41AM -0400, tty@REDACTED wrote: > Hello, > > Thank you for your reply. Here is a sample screen > shot of both sessions. One major difference (as I hinted) is that the telnet session will CRNL terminate each line. Try that in the erlang code as well. gen_tcp:send(Fd, "ati\r\n") /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From tty@REDACTED Wed Jun 1 19:53:13 2005 From: tty@REDACTED (tty@REDACTED) Date: Wed, 1 Jun 2005 13:53:13 -0400 Subject: Erlang socket client Message-ID: Thanks, > will CRNL terminate each line. Try that in the erlang code > as well. > > gen_tcp:send(Fd, "ati\r\n") > > That did it. Its still flaky with responses (not flushing the recieve buffer) but I can live with it for now since its meant as a proof of concept demo. Regards Tee From klacke@REDACTED Wed Jun 1 20:55:51 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Wed, 1 Jun 2005 20:55:51 +0200 Subject: Erlang socket client In-Reply-To: References: Message-ID: <20050601185551.GA7283@hyber.org> On Wed, Jun 01, 2005 at 01:53:13PM -0400, tty@REDACTED wrote: > Thanks, > > > will CRNL terminate each line. Try that in the erlang code > > as well. > > > > gen_tcp:send(Fd, "ati\r\n") > > > > > > That did it. Its still flaky with responses (not flushing the recieve buffer) but I can live with it for now since its meant as a proof of concept demo. > Yes, and it's always going to be flaky unless you somehow instruct erlang how/when to deliver data to you. Erlang cannot know how you want data delivered to you from the socket unless you tell it. Thus, the server ships CRNL terminated lines to you, thus you should pass the option: gen_tcp:connect(....[{packet, line} ...]) That way, you'll get a line delivered to your process as soon as a full CRNL terminated line is read by the driver. Readup in # man -a inet on how erlang socket line mode works /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From tty@REDACTED Wed Jun 1 22:54:03 2005 From: tty@REDACTED (tty@REDACTED) Date: Wed, 1 Jun 2005 16:54:03 -0400 Subject: Erlang socket client Message-ID: > > Readup in > > # man -a inet > > on how erlang socket line mode works > > Thanks for that note. I was looking for a buffer flush under gen_tcp:recv instead i.e. looking at the wrong place. Regards Tee From erlang@REDACTED Thu Jun 2 15:37:22 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Thu, 2 Jun 2005 10:37:22 -0300 Subject: Yaws + SSL + OpenSSL --> CPU 100% Message-ID: <01f801c56778$3ad8cb70$4a00a8c0@Inswitch251> Hi, I'm using yaws on W2000 with ssl. I have succesfully logged into the webserver but I've seen that the SSL application port (ssl_esock.exe) that comes with ERL5.4 grows on CPU usage to 100. I've made some debug on the ssl_esock.exe trying to find some clues. Does someone have experience with this? thanks in advance, Eduardo Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Ing. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: From sean.hinde@REDACTED Thu Jun 2 18:28:12 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Thu, 02 Jun 2005 09:28:12 -0700 Subject: epoll support? Message-ID: <3321291.1117729692144.JavaMail.sean.hinde@mac.com> Hi, Various people have asked, but no-one has answered yet - are there any plans to include support for the epoll mechanism of Linux 2.6? There is kpoll support in erlang, but kpoll is not in Linux 2.6. Thanks, Sean From tony@REDACTED Thu Jun 2 22:15:38 2005 From: tony@REDACTED (Tony Rogvall) Date: Thu, 2 Jun 2005 22:15:38 +0200 Subject: epoll support? In-Reply-To: <3321291.1117729692144.JavaMail.sean.hinde@mac.com> References: <3321291.1117729692144.JavaMail.sean.hinde@mac.com> Message-ID: 2 jun 2005 kl. 18.28 skrev Sean Hinde: > Hi, > > Various people have asked, but no-one has answered yet - are there > any plans to include support for the epoll mechanism of Linux 2.6? > > There is kpoll support in erlang, but kpoll is not in Linux 2.6. > Since epoll was introduced into kernel 2.6 there is no need to port kpoll any more. The reason to build kpoll was to implement level triggered poll instead of edge triggered poll (note e for edge). Level triggered poll is more like the regular poll and easier to use. The idea was to patch epoll and add level triggered poll, but the author of epoll refused! Why He later changed his mind and let the kernel 2.6 include both modes (level triggered poll is even the default) I can not even imagine. In the kernel 2.6 you can actually select the behaviour on file descriptor basis. Read more about the api here. http://www.annodex.net/cgi-bin/man/man2html?4+epoll suggest to add configure test for epoll with level triggered support (i.e kernel 2.6) /Tony From luke@REDACTED Thu Jun 2 22:12:44 2005 From: luke@REDACTED (Luke Gorrie) Date: 02 Jun 2005 22:12:44 +0200 Subject: [announce] Erlang ported to linksys nslu2 References: Message-ID: "Brian Zhou" writes: > Hi all, > > I'm pleased to announce that the latest erlang R10B-5 has been ported > to run on linksys nslu2, complete with SAE and openssl support, but > with HiPE disabled. Holy crap, a silent 150gram linux box for 795 kronor! We bought a few of these today. I installed Openslug on mine, added a memory stick, and installed a bunch of binaries from this ipkg dir: http://ipkg.nslu2-linux.org/feeds/openslug/oe but there was no Erlang and not enough for a working gcc (no binutils). Any tips? Should I go for Unslung instead? Thanks for the great pointer! -Luke From erlang@REDACTED Thu Jun 2 22:36:11 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Thu, 2 Jun 2005 17:36:11 -0300 Subject: Yaws + SSL in non Win32 OS Message-ID: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> Hi, Has someone successfully used Yaws + SSL in non Win32 OS? thanks, Eduardo Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Ing. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: From erlang@REDACTED Thu Jun 2 23:06:49 2005 From: erlang@REDACTED (Michael McDaniel) Date: Thu, 2 Jun 2005 14:06:49 -0700 Subject: Yaws + SSL in non Win32 OS In-Reply-To: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> References: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> Message-ID: <20050602210649.GF12205@fangora.autosys.us> compressed, On Thu, Jun 02, 2005 at 05:36:11PM -0300, Inswitch Solutions wrote: > > Hi, > Has someone successfully used Yaws + SSL in non Win32 OS? > thanks, > Eduardo > [cid:02a801c567b2$b6b768c0$4a00a8c0@REDACTED] > > Prepaid Expertise - Programmable Switches > Powered by Ericsson Licensed Technology > Ing. Eduardo Figoli - Development Center - IN Switch Solutions Inc. > Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 > Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 > e-mail: [1]eduardo@REDACTED > References > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The following worked for me on Linux and then httpS://localhost works $ cd /opt/src/otp_src_R10B-4/ $ cd lib/ssl/c_src $ mkdir RCS $ ci -l esock.c $ emacs esock.c FROM: #define RWBUFLEN 4096 TO: #define RWBUFLEN (32*1024) $ cd - $ export ERLANG_COMMERCIAL_BUILD="Automated Systems" $ ./configure --with-odbc --x-includes=/usr/local/include --x-libraries=/usr/lib --with-ssl $ make $ sudo make install $ cd /opt/src/yaws-1.54 $ ./configure $ make $ make docs $ sudo make install make sure this is in /etc/yaws.conf port = 443 listen = 0.0.0.0 docroot = /var/yaws/www dir_listings = true keyfile = /etc/yaws-key.pem certfile = /etc/yaws-cert.pem ~Michael From serge@REDACTED Fri Jun 3 03:52:05 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 02 Jun 2005 21:52:05 -0400 Subject: error_logger and sasl Message-ID: <429FB7C5.3000106@hq.idt.net> I would like to be able to ensure that the content of a log file produced by the error_logger and sasl doesn't get overwriten when a node is restarted. Upon examining the error_logger_file_h.erl I found that a log file is being open with a 'write' option that causes the log file to be truncated: init(File, PrevHandler) -> process_flag(trap_exit, true), case file:open(File, write) of {ok,Fd} -> {ok, {Fd, File, PrevHandler}}; Error -> Error end. Was there any specific consideration for this design? I would like to request a feature to either customize this mode (by choosing between 'write' and 'append') or changing it to 'append'. Thanks. Serge From vlad_dumitrescu@REDACTED Fri Jun 3 11:05:39 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 03 Jun 2005 11:05:39 +0200 Subject: Edoc suggestions In-Reply-To: <42A00763.7000203@csd.uu.se> Message-ID: Hi, After submitting the "first real edoc bug report in ages" (quoting Richard Carlsson) I also have some improvement suggestions. If it's already possible, it should at least be documented better. It would be nice if the global 'private' option could be overriden at module and function level. I want only some modules to be processed in 'private' mode. Also, using private mode, one needs to add @hidden tags all over the place. I'd like to suggest the following changes: - @hidden works as it does now, unconditionally - @private declares module/function as private, documentation should be generated - @public declares module/function as public, documentation should be generated - modify 'private' option's semantics so that private=false generates only public & not hidden modules/functions, disregarding tags private=true delegates to the module/function tags - @private and @public at module level basically define the default value for the functions This way no change is needed for generating truly public documentation, and for generating private documentation one can only tag those parts that are affected. It's not fun to go through files, adding @hidden tags... :-) I'm not sure if this is a complete solution, but might be a basis for discussion. best regards, Vlad _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From heinrich@REDACTED Fri Jun 3 12:13:18 2005 From: heinrich@REDACTED (Heinrich Venter) Date: Fri, 3 Jun 2005 12:13:18 +0200 Subject: Archive search down? Message-ID: Hi Any one know what happened to the mailing list archive search function on the website, or when it will be back? -]-[ Alt = iFind ? Visit our website here http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313334343632363a33303639373a2d323a353137 Launchpad - View our website here http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313334343632363a33303639373a2d323a333738 Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Cellfind (Pty) Ltd is proprietary to the company. It is confidential, legally privileged and protected by law. Cellfind (Pty) Ltd does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Cellfind (Pty) Ltd. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Cellfind (Pty) Ltd can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MTk2LjMwLjc5LjE1NQ== Type: image/gif Size: 620 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MTk2LjMwLjc5LjE1NQ== Type: image/gif Size: 15658 bytes Desc: not available URL: From luke@REDACTED Fri Jun 3 12:35:22 2005 From: luke@REDACTED (Luke Gorrie) Date: 03 Jun 2005 12:35:22 +0200 Subject: Archive search down? References: Message-ID: "Heinrich Venter" writes: > Hi > > Any one know what happened to the mailing list archive search function > on the website, or when it will be back? The Gmane archive at http://news.gmane.org/gmane.comp.lang.erlang.general has the past three years of posts. Maybe someone could send them an mbox file of the rest? P.S. I read and post to erlang-questions through Gmane and it's a nuisance to receive it via SMTP aswell. Is there a way I can retain my posting rights without getting the list delivered to my mailbox? No big deal but Gmane is the future and we have to accept it :-) From vlad.xx.dumitrescu@REDACTED Fri Jun 3 12:44:47 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 3 Jun 2005 12:44:47 +0200 Subject: Archive search down? Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE570@esealmw105.eemea.ericsson.se> > Any one know what happened to the mailing list archive search function > on the website, or when it will be back? You could use the forum at http://www.trapexit.org instead, the search goes much, much faster. regards, Vlad From tim@REDACTED Fri Jun 3 14:23:42 2005 From: tim@REDACTED (Tim Bates) Date: Fri, 03 Jun 2005 21:53:42 +0930 Subject: Redundancy, gen_leader and network splits Message-ID: <42A04BCE.5000600@bates.id.au> Hi folks, I want to set up an Erlang system with multiple nodes for redundancy. The system will be used to drive an external Web Services interface, so I only want one node at a time to be attempting to to communicate with the Web Service. gen_leader appears to be what I want to use, so that one node at a time is the "leader" and talks to the Web Service and the others sit around replicating the database doing mostly nothing until the leader has a power failure or network outage and one of the running nodes takes over. I'm not quite sure on the details of how I'd use gen_leader to achieve this, but I'm working on it... Does the version of gen_leader in jungerl fix the bug that was discussed on this mailing list a while ago in the election process? I found a leader_new.erl file on the internet which purports to fix this but it appears to be just a sample implementation of the algorithm and doesn't implement all the hooks etc that gen_leader.erl does. Finally, I want to be absolutely sure that there won't be two nodes both thinking they're the leader at the same time, which I don't think gen_leader ensures. For example: I have three nodes A, B and C, and A is the leader. A's connection to B and C goes down but not its connection to the Web Service. B and C will elect a new leader between them and A will still think it is the leader. Both will try and interact with the Web Service, which is what's known as a Bad Thing. The way I could see this working is that a node will only become the leader if it has a connection to more than 50% of the other candidates. This way, in the example above A will relinquish its leader status because it can't reach B or C, and B and C will elect a new leader and everything works. This scales to an arbitrary number of nodes; in any network split, at most one pool of connected nodes will remain connected to 50% of the candidates. Of course if the network split results in three pools of unconnected nodes where none can see more than 50% of the network then there will be no leader, but for my application this is much better than having two leaders. How difficult would it be to add this behaviour to gen_leader? Thanks, Tim. -- Tim Bates tim@REDACTED From ulf.wiger@REDACTED Fri Jun 3 16:22:37 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 3 Jun 2005 16:22:37 +0200 Subject: Redundancy, gen_leader and network splits Message-ID: Tim Bates wrote: > > Does the version of gen_leader in jungerl fix the > bug that was discussed on this mailing list a while > ago in the election process? I'm not sure. The guys in G?teborg are working on it, but I think that a new leader-election algorithm basically has to be invented. ;-) > Finally, I want to be absolutely sure that there > won't be two nodes both thinking they're the leader > at the same time, which I don't think gen_leader ensures. It doesn't. It's of course a pathological case in that there is no generic solution to the problem. What one would like to have is a method to detect it. One thing that should work is to turn off auto-connect on your nodes (this is done with the configuration parameter -kernel dist_auto_connect always | never | once) If you set it to e.g. 'once', two nodes will not reconnect unless at least one of the nodes restarts (in which case it is able to connect automatically to the other). This way, if you suffer intermittent loss of erlang communication, the network will stay separated until you've figured out what to do. You can detect the situation e.g. by letting the gen_leader processes ping each other through a "back door" (say, using UDP). If one leader gets a backdoor ping from a node that's not in the nodes() list, you have a problem, and need to decide who gets to yield. I don't think gen_leader has to be modified in order to do this. You can do it on the side and reboot the "minority leader", once identified. /Uffe From raimo@REDACTED Fri Jun 3 17:16:31 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 03 Jun 2005 17:16:31 +0200 Subject: Archive search down? References: Message-ID: We have just upgraded webservers and the mailing list search function si something we have missed. We will look into that. Thank you! heinrich@REDACTED (Heinrich Venter) writes: > Hi > > Any one know what happened to the mailing list archive search function > on the website, or when it will be back? > > -]-[ > > > Alt = iFind ? Visit our website here > http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313334343632363a33303639373a2d323a353137 > > Launchpad - View our website here > http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313334343632363a33303639373a2d323a333738 > > Disclaimer and confidentiality note > > Everything in this e-mail and any attachments relating to the official business of Cellfind (Pty) Ltd is proprietary to the company. It is confidential, legally privileged and protected by law. Cellfind (Pty) Ltd does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Cellfind (Pty) Ltd. > > The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. > > Cellfind (Pty) Ltd can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From thomas.arts@REDACTED Fri Jun 3 18:03:24 2005 From: thomas.arts@REDACTED (Thomas Arts) Date: Fri, 03 Jun 2005 18:03:24 +0200 Subject: Redundancy, gen_leader and network splits In-Reply-To: References: Message-ID: <42A07F4C.6090202@ituniv.se> The guys in G?teborg came up with a complete new algorithm, of which a beta version was only released to Sean so far... We are writing up a paper about it for the Erlang workshop at the moment. I guess Hans Svensson (the brain behind all this) will post the new version soon after we finished the paper. We have very extensively tested that version, with two new testing technologies. "Testing can only reveal errors, not the absense of it" (Dijkstra), hence we cannot be 100% sure. However, there are few products on the market tested that well. /Thomas Ulf Wiger (AL/EAB) wrote: >Tim Bates wrote: > > >>Does the version of gen_leader in jungerl fix the >>bug that was discussed on this mailing list a while >>ago in the election process? >> >> > >I'm not sure. The guys in G?teborg are working on it, >but I think that a new leader-election algorithm >basically has to be invented. ;-) > > > >>Finally, I want to be absolutely sure that there >>won't be two nodes both thinking they're the leader >>at the same time, which I don't think gen_leader ensures. >> >> > >It doesn't. It's of course a pathological case in >that there is no generic solution to the problem. >What one would like to have is a method to detect >it. > >One thing that should work is to turn off auto-connect >on your nodes (this is done with the configuration >parameter -kernel dist_auto_connect always | never | once) >If you set it to e.g. 'once', two nodes will not >reconnect unless at least one of the nodes restarts >(in which case it is able to connect automatically >to the other). This way, if you suffer intermittent >loss of erlang communication, the network will stay >separated until you've figured out what to do. >You can detect the situation e.g. by letting the >gen_leader processes ping each other through a >"back door" (say, using UDP). If one leader gets a >backdoor ping from a node that's not in the nodes() >list, you have a problem, and need to decide who gets >to yield. > >I don't think gen_leader has to be modified in order >to do this. You can do it on the side and reboot >the "minority leader", once identified. > >/Uffe > > From sean.hinde@REDACTED Fri Jun 3 18:16:23 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 3 Jun 2005 17:16:23 +0100 Subject: Redundancy, gen_leader and network splits In-Reply-To: <42A07F4C.6090202@ituniv.se> References: <42A07F4C.6090202@ituniv.se> Message-ID: <238CFF40-0AA9-4C84-8D74-C94B5684CB1B@mac.com> On 3 Jun 2005, at 17:03, Thomas Arts wrote: > > The guys in G?teborg came up with a complete new algorithm, of which > a beta version was only released to Sean so far... Who is ashamed to say that he has not tried it yet :( Sean From b88zhou@REDACTED Fri Jun 3 19:10:10 2005 From: b88zhou@REDACTED (Brian Zhou) Date: Fri, 3 Jun 2005 10:10:10 -0700 Subject: [announce] Erlang ported to linksys nslu2 References: Message-ID: http://ipkg.nslu2-linux.org/feeds/unslung/native/erlang_R10B5-3_armeb.ipk I ported and did some basic test of the package in unslung firmware. You can try it on openembedded firmware and report back to both groups whether it works or not. I just got my second slug and plan to install OE on it. I'm working on making the package cross built, although not ready for general testing yet, but it basically works. It's not as difficult as I thought. I'll share the general step when I'm ready. Cheers, -Brian ----- Original Message ----- From: "Luke Gorrie" To: Sent: 2005 Jun 02 1:12 PM Subject: Re: [announce] Erlang ported to linksys nslu2 > Holy crap, a silent 150gram linux box for 795 kronor! > > We bought a few of these today. I installed Openslug on mine, added > a memory stick, and installed a bunch of binaries from this ipkg dir: > > http://ipkg.nslu2-linux.org/feeds/openslug/oe > > but there was no Erlang and not enough for a working gcc (no > binutils). Any tips? Should I go for Unslung instead? > > Thanks for the great pointer! > > -Luke > > > From kramer@REDACTED Fri Jun 3 20:53:23 2005 From: kramer@REDACTED (Reto Kramer) Date: Fri, 3 Jun 2005 11:53:23 -0700 Subject: exit in fun running via timer:apply_interval/4 Message-ID: <6016e20aba8715cab5e92429ccff4df6@acm.org> Folks, I'm looking for the best (elegant) way to make sure that if there's an exit in the Mod:Fun that I run via timer:apply_interval/4, the "parent" process (the one that scheduled the timer) will receive the exit message, so I can programmatically react to it (and e.g. shutdown my system). I'm sure someone out there has an elegant solution. Thanks! - Reto From thantos@REDACTED Sat Jun 4 02:49:28 2005 From: thantos@REDACTED (Alexander Williams) Date: Fri, 3 Jun 2005 20:49:28 -0400 Subject: Del.icio.us Interface Message-ID: <873458812.20050603204928@speedfactory.net> erlang-questions: Before I try and reimpliment the wheel, I really should ask if anyone has implimented an Erlang version of the Del.icio.us tagging API? I'm well aware there's a fairly nice Python implimentation, but it seems the sort of thing that Erlang would do quite neatly as a process that can take and emit messages. -- Alexander Williams (thantos@REDACTED) The Squid's Redoubt: http://chancel.org:8000/Redoubt Currently Playing: Richard Cheese - Gin & Juice Album: I'd Like a Virgin From will@REDACTED Sat Jun 4 19:30:44 2005 From: will@REDACTED (Will Newton) Date: Sat, 4 Jun 2005 18:30:44 +0100 Subject: Using inets http client Message-ID: <200506041830.44582.will@misconception.org.uk> Following the documentation of the inets http client I have written this code: http_wait_with_timeout(RequestId, Timeout) -> if Timeout > 0 -> receive {http, {RequestId, Result}} -> Result; {http, {RequestId, {error, Reason}}} -> throw({error, Reason}) after 1000 -> io:format(".") end, http_wait_with_timeout(RequestId, Timeout - 1000); true -> throw({timeout}) end. get_url(Url) -> application:start(inets), case http:request(get, {Url, []}, [], [{sync, false}]) of {ok, RequestId} -> http_wait_with_timeout(RequestId, 15000); _ -> io:format("http request failed~n") end. I get a series of periods printed but I never get the expected response from the async http request. Can anyone tell me what am I doing wrong? Thanks, From laheadle@REDACTED Sat Jun 4 20:03:18 2005 From: laheadle@REDACTED (Lyn Headley) Date: Sat, 4 Jun 2005 11:03:18 -0700 (PDT) Subject: debug tips? In-Reply-To: <20050601132433.61733.qmail@web41901.mail.yahoo.com> Message-ID: <20050604180318.65506.qmail@web31102.mail.mud.yahoo.com> In case more opinions are welcomed, I'd like to add that in learning erlang I've found the lack of stack traces in exceptions to be a serious impediment. Perhaps this is laziness on my part for not thoroughly exploring and learning the available erlang style methods (for information concerning which I appreciate Ulf Wiger's recent post). But I find tracing to be sometimes a clumsier solution and find myself wishing for a stack trace. Lyn --- Thomas Lindgren wrote: > > > --- "ke.han" wrote: > > > I feel like there must have been a better way to > > close in on the error > > than what I did. For example, is there a way to get > > a report when > > another process "throws" an error. > > You can monitor other processes with the trace BIF and > the dbg module, though I can't say whether it helps in > this case. > > > What if I have > > no idea, as in this > > case, how the error was generated..the "error" tuple > > was simply passed > > back to the Client process. Any suggestions? > > I'd like more informative exceptions too. I tend to > use my smart_exceptions package (see Jungerl) as a > compiler prepass. This adds module, line number, etc. > to the exception ... but that only helps for code you > have compiled yourself, and, since R10, causes masses > of (useless) warnings from the compiler to boot. The > real solution would be to extend the runtime system, > though. > > http://www.erlang.org/ml-archive/erlang-questions/200310/msg00237.html > > (Adding some nice way to categorize exceptions would > be useful too. Inheritance, anyone? :-) > > Best, > Thomas > > > > > __________________________________ > Discover Yahoo! > Stay in touch with email, IM, photo sharing and more. Check it out! > > http://discover.yahoo.com/stayintouch.html > __________________________________ Discover Yahoo! Find restaurants, movies, travel and more fun for the weekend. Check it out! http://discover.yahoo.com/weekend.html From erlang@REDACTED Sat Jun 4 21:37:59 2005 From: erlang@REDACTED (Michael McDaniel) Date: Sat, 4 Jun 2005 12:37:59 -0700 Subject: Using inets http client In-Reply-To: <200506041830.44582.will@misconception.org.uk> References: <200506041830.44582.will@misconception.org.uk> Message-ID: <20050604193758.GJ12205@fangora.autosys.us> On Sat, Jun 04, 2005 at 06:30:44PM +0100, Will Newton wrote: > > Following the documentation of the inets http client I have written this code: > > http_wait_with_timeout(RequestId, Timeout) -> > if > Timeout > 0 -> > receive > {http, {RequestId, Result}} -> > Result; > {http, {RequestId, {error, Reason}}} -> > throw({error, Reason}) > after > 1000 -> > io:format(".") > end, > http_wait_with_timeout(RequestId, Timeout - 1000); > true -> > throw({timeout}) > end. > > get_url(Url) -> > application:start(inets), > case http:request(get, {Url, []}, [], [{sync, false}]) of > {ok, RequestId} -> > http_wait_with_timeout(RequestId, 15000); > _ -> > io:format("http request failed~n") > end. > > I get a series of periods printed but I never get the expected response from > the async http request. Can anyone tell me what am I doing wrong? > > Thanks, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ per documentation of http.html , (on my system, at http:///usr/local/lib/erlang/doc/index.html and choose http.html) " request(Method, Request, HTTPOptions, Options) -> {ok, Result} | {error, Reason} " It appears that when the http:request/4 returns (successfully), http_wait_with_timeout(RequestId, 15000) is then called and prints dots. I suggest adding io:format'~p~n', [RequestId]) , just before the call to http_wait_with_timeout(RequestId, 15000) in get_url/1 and see what gets printed. ~Michael From vances@REDACTED Sun Jun 5 03:49:05 2005 From: vances@REDACTED (Vance Shipley) Date: Sat, 4 Jun 2005 21:49:05 -0400 Subject: SNMP instrumentation operation 'delete' not called Message-ID: <20050605014905.GN71093@feeble.motivity.ca> The SNMP User's Guide describes the instrumentation callback functions in section 10; Definition of Instrumentation Functions: "THE function f(delete [, ExtraArgs]) is called for each object in an MIB when the MIB is unloaded from the agent. This makes it possible to perform necessary clean-up." However this function never gets called! I see 'new' operation get called but never 'delete': fooVar(Op) -> io:fwrite("fooVar(~w)~n", [Op]). 1> snmpa:load_mibs(snmp_master_agent, ["FOO-MIB"]). fooVar(new) ok 2> snmpa:unload_mibs(snmp_master_agent, ["FOO-MIB"]). ok I'm assuming this is a bug in either the documentation or implementation. I had been intending to use these callbacks to turn SNMP indexing on and off on the tables being accessed: fooTable(new) -> mnesia:snmp_open_table(fooTable, [{key, string}]); ...; fooTable(delete) -> mnesia:snmp_close_table(fooTable, [{key, string}]), .... This would allow the table accesses to occur without the extra overhead of SNMP indexing when SNMP was not in use. -Vance From will@REDACTED Sun Jun 5 04:24:03 2005 From: will@REDACTED (Will Newton) Date: Sun, 5 Jun 2005 03:24:03 +0100 Subject: Using inets http client In-Reply-To: <20050604193758.GJ12205@fangora.autosys.us> References: <200506041830.44582.will@misconception.org.uk> <20050604193758.GJ12205@fangora.autosys.us> Message-ID: <200506050324.04074.will@misconception.org.uk> On Saturday 04 June 2005 20:37, Michael McDaniel wrote: Thanks for your quick reply. > It appears that when the http:request/4 returns (successfully), > http_wait_with_timeout(RequestId, 15000) is then called and prints dots. > > I suggest adding > io:format'~p~n', [RequestId]) , > > just before the call to http_wait_with_timeout(RequestId, 15000) in > get_url/1 and see what gets printed. #Ref<0.0.0.68> I'm not sure how to interpret this value... From erlang@REDACTED Sun Jun 5 06:48:12 2005 From: erlang@REDACTED (Michael McDaniel) Date: Sat, 4 Jun 2005 21:48:12 -0700 Subject: Using inets http client In-Reply-To: <200506050324.04074.will@misconception.org.uk> References: <200506041830.44582.will@misconception.org.uk> <20050604193758.GJ12205@fangora.autosys.us> <200506050324.04074.will@misconception.org.uk> Message-ID: <20050605044812.GM12205@fangora.autosys.us> On Sun, Jun 05, 2005 at 03:24:03AM +0100, Will Newton wrote: > On Saturday 04 June 2005 20:37, Michael McDaniel wrote: > > Thanks for your quick reply. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You are welcome. ~M > > > It appears that when the http:request/4 returns (successfully), > > http_wait_with_timeout(RequestId, 15000) is then called and prints dots. > > > > I suggest adding > > io:format'~p~n', [RequestId]) , > > > > just before the call to http_wait_with_timeout(RequestId, 15000) in > > get_url/1 and see what gets printed. > > #Ref<0.0.0.68> > > I'm not sure how to interpret this value... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Apologies for any confusion I caused. I am accustomed to using http:request/4 synchronously and directly and using the URL response returned. When I wrote the first note I had not run the code you provided. >From looking at it, I was thinking that 'RequestId' would actually contain the result from the request. Of course it does not. Now I also am confused about why this is not working. Interestingly, this get_url(Url) -> application:start(inets), case (catch http:request(get, {Url, []}, [], [{sync, false}])) of {ok, RequestId} -> receive {http, {RequestId, Result}} -> io:format('~p~n', [Result]) ; {http, {RequestId, {error, Reason}}} -> throw({error, Reason}) after 7000 -> throw({timeout}) end ; _ -> io:format("http request failed~n") end. will return the Result. According to documentation of http:request/4, "... a message will be sent to the calling process on the format ...". Both get_url/1 and http_wait_with_timeout/2 have the same process id so I am not understanding why the result does not come back to http_wait_with_timeout/2 but does come back to get_url/1. The following will retry also. get_url(Url, Timeout) -> application:start(inets), if Timeout < 0 -> exit({timeout}) ; true -> true end , case (catch http:request(get, {Url, []}, [], [])) of {ok, Result} -> {ok, Result} ; _ -> io:format('.', []) , timer:sleep(1000) , get_url(Url, Timeout-1000) end. Any help from others about the original code is welcome. ~Michael From robert.virding@REDACTED Sun Jun 5 11:28:07 2005 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 05 Jun 2005 11:28:07 +0200 Subject: receive after In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE56A@esealmw105.eemea.ericsson.se> References: <11498CB7D3FCB54897058DE63BE3897C4BE56A@esealmw105.eemea.ericsson.se> Message-ID: <42A2C5A7.4060308@telia.com> No, the main reason is that, for better or worse, the semicolon is a seperator not a terminator. For the same reason you can't have/don't need a semicolon before the final dot in a function definition. Consistency. Robert Vlad Dumitrescu XX (LN/EAB) wrote: >From: Dietmar Schaefer > > >>I am just reading http://www.erlang.se/doc/doc-5.4/doc/reference_manual/part_frame.html >> >> > >Hello, > >There is a type in the documentation, the last clause in a receive or in a case must not have any semicolons after them. > >BTW, is there a compelling reason why that is so? Why not let all clauses end with semicolon? It's much easier to reorder them by simply copy-and-paste :-) > >I think I already can guess the answer - the parser would need larger lookahead to understand what's going on... Is it so? > >regards, >Vlad > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.virding@REDACTED Sun Jun 5 11:31:45 2005 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 05 Jun 2005 11:31:45 +0200 Subject: implementation of suffix In-Reply-To: References: Message-ID: <42A2C681.4090906@telia.com> I would say a bug, but in which clause is debatable. Robert Ulf Wiger (AL/EAB) wrote: >The implementation of lists:suffix/2 is as follows: > > >suffix(Suffix, Suffix) -> true; >suffix(Suffix, [_|Tail]) -> > suffix(Suffix, Tail); >suffix(_, []) -> false. > > >The programming style in lists.erl seems to be to be very conservative >about using type guards. One objection to this could be that it makes >it more difficult for Dialyzer to derive good type information from one of >the most frequently used modules, but in the case of suffix/2, I would >say that it also violates the Principle of Least Astonishment: > >(n@REDACTED)13> lists:suffix(a,[1,2,3|a]). >true >(n@REDACTED)14> lists:suffix(b,[1,2,3|a]). >** exited: {function_clause,[{lists,suffix,[b,a]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > >=ERROR REPORT==== 27-May-2005::15:36:23 === >Error in process <0.95.0> on node 'n@REDACTED' with exit value: {function_clause,[{lists,suffix,[b,a]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > >Bug or feature? > >/Uffe > > > From will@REDACTED Sun Jun 5 18:38:36 2005 From: will@REDACTED (Will Newton) Date: Sun, 5 Jun 2005 17:38:36 +0100 Subject: Using inets http client In-Reply-To: <20050605044812.GM12205@fangora.autosys.us> References: <200506041830.44582.will@misconception.org.uk> <200506050324.04074.will@misconception.org.uk> <20050605044812.GM12205@fangora.autosys.us> Message-ID: <200506051738.37088.will@misconception.org.uk> On Sunday 05 June 2005 05:48, Michael McDaniel wrote: > Now I also am confused about why this is not working. > > Interestingly, this Yes, you're right. It's almost as if the function call http_wait_with_timeout/2 makes the message go missing or changes the pid or... I can't really figure it out. I'm rather new to Erlang and this is well beyond my knowledge. :) > Any help from others about the original code is welcome. One other question I had: I am assuming my http_wait_with_timeout/2 function will have the tail call eliminated by the compiler. Is there some way I can test whether this is happening or not or do I have to rely on inspecting the code? From erlang@REDACTED Sun Jun 5 19:15:57 2005 From: erlang@REDACTED (Michael McDaniel) Date: Sun, 5 Jun 2005 10:15:57 -0700 Subject: Using inets http client In-Reply-To: <200506051738.37088.will@misconception.org.uk> References: <200506041830.44582.will@misconception.org.uk> <200506050324.04074.will@misconception.org.uk> <20050605044812.GM12205@fangora.autosys.us> <200506051738.37088.will@misconception.org.uk> Message-ID: <20050605171557.GV12205@fangora.autosys.us> On Sun, Jun 05, 2005 at 05:38:36PM +0100, Will Newton wrote: > On Sunday 05 June 2005 05:48, Michael McDaniel wrote: > > > Now I also am confused about why this is not working. > > > > Interestingly, this > > Yes, you're right. It's almost as if the function call > http_wait_with_timeout/2 makes the message go missing or changes the pid > or... I can't really figure it out. I'm rather new to Erlang and this is well > beyond my knowledge. :) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I do not think it is a pid issue, io:format('~p~n', [self()]) shows same pid in each fun. > > > Any help from others about the original code is welcome. > > One other question I had: I am assuming my http_wait_with_timeout/2 function > will have the tail call eliminated by the compiler. Is there some way I can > test whether this is happening or not or do I have to rely on inspecting the > code? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Best as I understand it, either 1) code inspection 2) let it run until it uses all the memory ~Michael From ke.han@REDACTED Mon Jun 6 08:26:42 2005 From: ke.han@REDACTED (ke.han) Date: Mon, 06 Jun 2005 14:26:42 +0800 Subject: nested case error Message-ID: <42A3ECA2.8090605@redstarling.com> Hello list, I have tried many punctuation styles around this nested case code example, but can't get it to compile. See line 15, where I have an end to the nested case and the last line where I end the outer case. I apologize for email formating, its the best Thunderbird would do... The compiler error on this code sample says I have an error before ';' on line 73 which is the end of the first clause of the outer case setupSocket(State) -> case gen_tcp:recv(State#state.sock, 0, ?server_idle_timeout) of {ok, Bin} -> [Two, One] = binary_to_list(Bin, 1, 2), Length = (Two * 256) + One, Version = [Major, Minor, Release] = binary_to_list(Bin, 3, 5), case binary_to_list(Bin, 6, 6) of [0] -> ClientType = type1; [1] -> ClientType = type2; [_Else] -> ClientType = unknown end, %% end of inner case [Four, Three, Two, One] = binary_to_list(Bin, 7, 10), SessionId = (Four * 16777216) + (Three * 65536)+ (Two * 256) + One, UserIdLength = binary_to_list(Bin, 11, 11), UserId = binary_to_list(Bin, 12, 12 + UserIdLength), PasswordLength = binary_to_list(Bin, 13 + UserIdLength, 13 + UserIdLength), Password = binary_to_list(Bin, 14 + UserIdLength, 14 + PasswordLength), io:format("Length\tVersion\tClientType\tSessionId\tUserIdLength\tUserId\tPasswordLength\tPassword",[]), io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, ClientType, SessionId, UserIdLength, UserId, PasswordLength, Password]; %% ERROR here - end of outer case first clause Else -> io:format(~p, [Else]) %% end of outer case second clause end. %% end of outer case thanks ke han From tpatro@REDACTED Mon Jun 6 08:28:49 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Mon, 6 Jun 2005 08:28:49 +0200 Subject: ESense 1.3 released In-Reply-To: References: Message-ID: Changes https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=332840 Files https://sourceforge.net/projects/esense/ Homepage http://esense.sourceforge.net/ In the README file there are some basic instructions on running ESense with an OTP version earlier than R10B. A motivated user (an AXD developer) is preparing a more detailed description of her experiences on setting up ESense with OTP R9. When she sends it to me I'll put it in the README file. /Tamas From kostis@REDACTED Mon Jun 6 10:19:25 2005 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 6 Jun 2005 10:19:25 +0200 (MEST) Subject: nested case error In-Reply-To: Mail from '"ke.han" ' dated: Mon, 06 Jun 2005 14:26:42 +0800 Message-ID: <200506060819.j568JPA7026836@spikklubban.it.uu.se> ke han wrote: > I have tried many punctuation styles around this nested case code > example, but can't get it to compile. Apparently, you have not tried putting a ")" before the ";"... > .... > io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, > ClientType, SessionId, UserIdLength, UserId, PasswordLength, Password]; > %% ERROR here - end of outer case first clause Best, Kostis From per.gustafsson@REDACTED Mon Jun 6 11:29:32 2005 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Mon, 06 Jun 2005 11:29:32 +0200 Subject: nested case error In-Reply-To: <42A3ECA2.8090605@redstarling.com> References: <42A3ECA2.8090605@redstarling.com> Message-ID: <42A4177C.1060603@it.uu.se> Maybe you should have a look at the bit syntax. It is described in chapter 6.16 of the erlang reference manual. It would allow you to rewrite your function in the following manner: setupSocket(State) -> case gen_tcp:recv(State#state.sock, 0, ?server_idle_timeout) of {ok, Bin} -> <> = Bin, Version = [Major,Minor,Release], UserId = binary_to_list(UId), Password = binary_to_list(Pw), ClientType = case CType of 0 -> type1; 1 -> type2; _ -> unknown end, io:format("Length\tVersion\tClientType\tSessionId\tUserIdLength\tUserId\tPasswordLength\tPassword",[]), io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, ClientType, SessionId, UIdLength, UserId, PwLength, Password]); Else -> io:format("~p", [Else]) end. Per Gustafsson > Hello list, > I have tried many punctuation styles around this nested case code > example, but can't get it to compile. > See line 15, where I have an end to the nested case and the last line > where I end the outer case. I apologize for email formating, its the > best Thunderbird would do... > The compiler error on this code sample says I have an error before ';' > on line 73 which is the end of the first clause of the outer case > > setupSocket(State) -> > case gen_tcp:recv(State#state.sock, 0, ?server_idle_timeout) of > {ok, Bin} -> > [Two, One] = binary_to_list(Bin, 1, 2), > Length = (Two * 256) + One, > Version = [Major, Minor, Release] = binary_to_list(Bin, 3, 5), > > case binary_to_list(Bin, 6, 6) of > [0] -> > ClientType = type1; > [1] -> > ClientType = type2; > [_Else] -> > ClientType = unknown > end, %% end of inner case > [Four, Three, Two, One] = binary_to_list(Bin, 7, 10), > SessionId = (Four * 16777216) + (Three * 65536)+ (Two * 256) + > One, > UserIdLength = binary_to_list(Bin, 11, 11), > UserId = binary_to_list(Bin, 12, 12 + UserIdLength), > PasswordLength = binary_to_list(Bin, 13 + UserIdLength, 13 + > UserIdLength), > Password = binary_to_list(Bin, 14 + UserIdLength, 14 + > PasswordLength), > io:format("Length\tVersion\tClientType\tSessionId\tUserIdLength\tUserId\tPasswordLength\tPassword",[]), > > io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, > ClientType, SessionId, UserIdLength, UserId, PasswordLength, > Password]; %% ERROR here - end of outer case first clause > Else -> > io:format(~p, [Else]) %% end of outer case second clause > end. %% end of outer case > > > thanks ke han From ke.han@REDACTED Mon Jun 6 12:29:18 2005 From: ke.han@REDACTED (ke.han) Date: Mon, 06 Jun 2005 18:29:18 +0800 Subject: nested case error In-Reply-To: <42A4177C.1060603@it.uu.se> References: <42A3ECA2.8090605@redstarling.com> <42A4177C.1060603@it.uu.se> Message-ID: <42A4257E.5010502@redstarling.com> Per, Wow...thanks...I did read the bit syntax section..after severl badarg errors, I gave up trying to figure out the syntax and hard coded it. YOur example is very imformative...thanks again. ke han Per Gustafsson wrote: > Maybe you should have a look at the bit syntax. It is described in > chapter 6.16 of the erlang reference manual. It would allow you to > rewrite your function in the following manner: > > setupSocket(State) -> > case gen_tcp:recv(State#state.sock, 0, ?server_idle_timeout) of > {ok, Bin} -> > < UIdLength,UId:UIdLength/binary, > PwLength,Pw:PwLength/binary,_/binary>> = Bin, > Version = [Major,Minor,Release], > UserId = binary_to_list(UId), > Password = binary_to_list(Pw), > ClientType = > case CType of > 0 -> type1; > 1 -> type2; > _ -> unknown > end, > > io:format("Length\tVersion\tClientType\tSessionId\tUserIdLength\tUserId\tPasswordLength\tPassword",[]), > > io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, > ClientType, SessionId, > UIdLength, UserId, PwLength, Password]); > Else -> > io:format("~p", [Else]) > end. > > Per Gustafsson > >> Hello list, >> I have tried many punctuation styles around this nested case code >> example, but can't get it to compile. >> See line 15, where I have an end to the nested case and the last line >> where I end the outer case. I apologize for email formating, its the >> best Thunderbird would do... >> The compiler error on this code sample says I have an error before ';' >> on line 73 which is the end of the first clause of the outer case >> >> setupSocket(State) -> >> case gen_tcp:recv(State#state.sock, 0, ?server_idle_timeout) of >> {ok, Bin} -> >> [Two, One] = binary_to_list(Bin, 1, 2), >> Length = (Two * 256) + One, >> Version = [Major, Minor, Release] = binary_to_list(Bin, 3, 5), >> case binary_to_list(Bin, 6, 6) of >> [0] -> >> ClientType = type1; >> [1] -> >> ClientType = type2; >> [_Else] -> >> ClientType = unknown >> end, %% end of inner case >> [Four, Three, Two, One] = binary_to_list(Bin, 7, 10), >> SessionId = (Four * 16777216) + (Three * 65536)+ (Two * 256) + >> One, >> UserIdLength = binary_to_list(Bin, 11, 11), >> UserId = binary_to_list(Bin, 12, 12 + UserIdLength), >> PasswordLength = binary_to_list(Bin, 13 + UserIdLength, 13 + >> UserIdLength), >> Password = binary_to_list(Bin, 14 + UserIdLength, 14 + >> PasswordLength), >> io:format("Length\tVersion\tClientType\tSessionId\tUserIdLength\tUserId\tPasswordLength\tPassword",[]), >> >> io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, >> ClientType, SessionId, UserIdLength, UserId, PasswordLength, >> Password]; %% ERROR here - end of outer case first clause >> Else -> >> io:format(~p, [Else]) %% end of outer case second clause >> end. %% end of outer case >> >> >> thanks ke han > > > > From ke.han@REDACTED Mon Jun 6 12:30:47 2005 From: ke.han@REDACTED (ke.han) Date: Mon, 06 Jun 2005 18:30:47 +0800 Subject: nested case error In-Reply-To: <200506060819.j568JPA7026836@spikklubban.it.uu.se> References: <200506060819.j568JPA7026836@spikklubban.it.uu.se> Message-ID: <42A425D7.1050509@redstarling.com> Jostis, thanks...I beleive I did have this right paren at one time but must have deleted it while I was trying different options on the case syntax. thanks for spotting this. ke han Kostis Sagonas wrote: > ke han wrote: > > > I have tried many punctuation styles around this nested case code > > example, but can't get it to compile. > > Apparently, you have not tried putting a ")" before the ";"... > > > .... > > io:format("~p\t~p\t~p\t~p\t~p\t~p\t~p\t~p", [Length, Version, > > ClientType, SessionId, UserIdLength, UserId, PasswordLength, Password]; > > %% ERROR here - end of outer case first clause > > Best, > Kostis > > From dietmar@REDACTED Mon Jun 6 18:27:42 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Mon, 06 Jun 2005 18:27:42 +0200 Subject: snmp instrumentation function Message-ID: <42A4797E.7060100@ast.dfs.de> Hi ! I have written an instrumentation function for my SNMP agent. Its based on mnesia and I have a doubled indexed table. I need to set a command. FOURD-MIB::fourDCommandType.171 = INTEGER: switchover(4) FOURD-MIB::fourDCommandType.555 = INTEGER: stop(1) 171 and 555 are the indices of different nodes. My instrumentation function outputs the RowIndex of the set command. If I set the variable indexed by 171 RowIndex = "/253" If I set the variable indexed by 555 RowIndex = 555 Does anybody know what that means ? Dietmar From serge@REDACTED Mon Jun 6 19:33:52 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 06 Jun 2005 13:33:52 -0400 Subject: shutting down a node remotely Message-ID: <42A48900.4060503@hq.idt.net> I need to shut down a node from another node. I know how it can be done with a function like: f(Node) -> rpc:cast(Node, init, stop, []). but is there a way to accomplish the same using "-remsh" or another erl's command-line option, like: host> erl -remsh b@REDACTED -sname a -cookie COOKIE -s init stop What I am getting in this case is that init:stop() gets evaluated at the a@REDACTED node instead of b@REDACTED I was also thinking of something like: erl -sname a -s rpc cast 't@REDACTED' init stop [] but the interpreter doesn't parse the last [] parameter as a list. Serge From matthias@REDACTED Mon Jun 6 20:02:00 2005 From: matthias@REDACTED (Matthias Lang) Date: Mon, 6 Jun 2005 20:02:00 +0200 Subject: shutting down a node remotely In-Reply-To: <42A48900.4060503@hq.idt.net> References: <42A48900.4060503@hq.idt.net> Message-ID: <17060.36760.771676.359151@antilipe.corelatus.se> Serge Aleynikov writes: > I need to shut down a node from another node. I know how it can be done > with a function like: > > f(Node) -> > rpc:cast(Node, init, stop, []). > > but is there a way to accomplish the same using "-remsh" or another > erl's command-line option, like: How about echo "rpc:call(Node, init, stop, [])." | erl -sname a This works under *nix. I don't know if it'll work under windows. Matthias From svg@REDACTED Mon Jun 6 20:23:32 2005 From: svg@REDACTED (Vladimir Sekissov) Date: Tue, 07 Jun 2005 00:23:32 +0600 (YEKST) Subject: shutting down a node remotely In-Reply-To: <42A48900.4060503@hq.idt.net> References: <42A48900.4060503@hq.idt.net> Message-ID: <20050607.002332.237363745.svg@surnet.ru> Good day, serge> I need to shut down a node from another node. I know how it can be done serge> with a function like: serge> serge> f(Node) -> serge> rpc:cast(Node, init, stop, []). serge> serge> but is there a way to accomplish the same using "-remsh" or another serge> erl's command-line option, like ...skipped You could try `erl_call': echo 'init:stop().' | erl_call -sname node -e It is usually compiled to $ERL_TOP/lib/erl_interface-*/bin/erl_call Best Regards, Vladimir Sekissov From klacke@REDACTED Mon Jun 6 21:18:41 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Mon, 6 Jun 2005 21:18:41 +0200 Subject: Yaws + SSL in non Win32 OS In-Reply-To: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> References: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> Message-ID: <20050606191841.GA25436@hyber.org> On Thu, Jun 02, 2005 at 05:36:11PM -0300, Inswitch Solutions wrote: > Hi, > > Has someone successfully used Yaws + SSL in non Win32 OS? > > This works just fine. I'm using it all the time. The SSL patch (esock.c buffersize) posted by Johan Bevemyr a couple of times must be applied though. It appears on the contrary to be ssl + win32 that is the most pain. SSL/erlang in bsd/linux runs and compiles just fine. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From erlang@REDACTED Mon Jun 6 21:23:40 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Mon, 6 Jun 2005 16:23:40 -0300 Subject: Yaws + SSL in non Win32 OS References: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> <20050606191841.GA25436@hyber.org> Message-ID: <027c01c56acd$42129080$4a00a8c0@Inswitch251> Hi Klacke, I can't find the patch you mention, please could you give the URL to download it? thanks, Eduardo Figoli ----- Original Message ----- From: To: "Inswitch Solutions" Cc: Sent: Monday, June 06, 2005 4:18 PM Subject: Re: Yaws + SSL in non Win32 OS > On Thu, Jun 02, 2005 at 05:36:11PM -0300, Inswitch Solutions wrote: > > Hi, > > > > Has someone successfully used Yaws + SSL in non Win32 OS? > > > > > > This works just fine. I'm using it all the time. > The SSL patch (esock.c buffersize) posted by Johan > Bevemyr a couple of times must be applied though. > > It appears on the contrary to be ssl + win32 that > is the most pain. SSL/erlang in bsd/linux runs and compiles > just fine. > > /klacke > > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > From klacke@REDACTED Mon Jun 6 21:53:37 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Mon, 6 Jun 2005 21:53:37 +0200 Subject: error_logger and sasl In-Reply-To: <429FB7C5.3000106@hq.idt.net> References: <429FB7C5.3000106@hq.idt.net> Message-ID: <20050606195337.GB25436@hyber.org> On Thu, Jun 02, 2005 at 09:52:05PM -0400, Serge Aleynikov wrote: > I would like to be able to ensure that the content of a log file > produced by the error_logger and sasl doesn't get overwriten when a node > is restarted. Upon examining the error_logger_file_h.erl I found that a > log file is being open with a 'write' option that causes the log file to > be truncated: In my n.s.h.o this behaviour is completely broken. In Yaws I fixed this with yaws_log_file_h.erl, take a look at that file because I don't think the OTP crew will ever change this since it's a backwards non compat change .. .. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From vances@REDACTED Mon Jun 6 23:21:05 2005 From: vances@REDACTED (Vance Shipley) Date: Mon, 6 Jun 2005 17:21:05 -0400 Subject: error_logger and sasl In-Reply-To: <20050606195337.GB25436@hyber.org> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> Message-ID: <20050606212105.GA749@feeble.motivity.ca> Serge, In a production environment you should be running an embedded system where run_erl is used to start the emulator. In this scenario the error_logger writes to tty and the run_erl program handles logging to disk. It does not truncate and uses rotating log files. -Vance From serge@REDACTED Mon Jun 6 23:47:56 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 06 Jun 2005 17:47:56 -0400 Subject: error_logger and sasl In-Reply-To: <20050606212105.GA749@feeble.motivity.ca> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> Message-ID: <42A4C48C.2060602@hq.idt.net> Vance, I see that there's some overlap in functionality of how the emulator can be started in production. Two ways are mentioned in the docs: 1. erl -detached -heart ... 2. run_erl -daemon ... Where run_erl manages log files, and lets to_erl program connect to the console. I believe the second feature is superseded by ^G command in the erl shell, where it is possible to connect a shell to a remote node (or is to_erl still preferable because it can really get access to the same console that started the node?). I was a bit hesitant to use run_erl because I wasn't sure if it could be reliably combined with the -heart option of starting the emulator. Would it be safe to do something like this in production: HEART_COMMAND= \ run_erl -daemon pipe_dir/ log_dir "erl -heart [command_arguments]" > run_erl -daemon pipe_dir/ log_dir "erl -heart [command_arguments]" In this case does the "erl" need to have any of the following: -detached -noshell? Upon examining a few projects (eddie, yaws, etc.) I saw that production systems are started using the "erl -detached ..." as opposed to run_erl method. Is it because it's more portable (i.e. run_erl is Linux/Solaris specific)? I'd appreciate it if you could comment on some of the questions I raised above. Regards, Serge Vance Shipley wrote: > Serge, > > In a production environment you should be running an embedded > system where run_erl is used to start the emulator. In this > scenario the error_logger writes to tty and the run_erl program > handles logging to disk. It does not truncate and uses rotating > log files. > > -Vance From vances@REDACTED Tue Jun 7 00:24:25 2005 From: vances@REDACTED (Vance Shipley) Date: Mon, 6 Jun 2005 18:24:25 -0400 Subject: error_logger and sasl\ In-Reply-To: <42A4C48C.2060602@hq.idt.net> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> Message-ID: <20050606222425.GD749@feeble.motivity.ca> On Mon, Jun 06, 2005 at 05:47:56PM -0400, Serge Aleynikov wrote: } } I see that there's some overlap in functionality of how the emulator can } be started in production. Two ways are mentioned in the docs: } } 1. erl -detached -heart ... } 2. run_erl -daemon ... The emulator itself is an executable named "beam". We always run it by calling the program named "erl" as it does a lot of stuff we don't care to know about. The "erl" program has a number of options to control how it behaves, some of which are useful in an embedded system. The "run_erl" program is a front end for "erl" which handles some of the issues inherent in an embedded system. So I think that there is no overlap, run_erl provides yet more functionality over erl. } I believe the second feature is superseded by ^G command in the erl } shell, where it is possible to connect a shell to a remote node (or is } to_erl still preferable because it can really get access to the same } console that started the node?). The group leader for a process defines where the "tty" output goes. If you use run_erl it receives all of this and logs it as well as allowing you to connect and use the real console. I have no idea what happens to the group leader when you run -detached. } I was a bit hesitant to use run_erl because I wasn't sure if it could be } reliably combined with the -heart option of starting the emulator. I've not used heart yet. } Would it be safe to do something like this in production: } } HEART_COMMAND= \ } run_erl -daemon pipe_dir/ log_dir "erl -heart [command_arguments]" The way you would normally start an embeded system is with is with ~/lib/erlang/bin/start. You may add -heart to the command line options there: $ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA -heart heart_command" } In this case does the "erl" need to have any of the following: -detached } -noshell? No! You definetly don't want those as you will be using the console shell. You may want to use some of the other options though: $ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA +A32 +Bi -sname embedded" } Upon examining a few projects (eddie, yaws, etc.) I saw that production } systems are started using the "erl -detached ..." as opposed to run_erl } method. Is it because it's more portable (i.e. run_erl is Linux/Solaris } specific)? The embedded system stuff was originally only targeted for Solaris and as such other OS users had to come up with their own. I assume that is what happened with Eddie. The situation today is much better, the embedded tools work with Solaris, FreeBSD, OS X and that other *nix. With yaws I think it's to minimize the OTP dependence. -Vance From serge@REDACTED Tue Jun 7 00:33:08 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 06 Jun 2005 18:33:08 -0400 Subject: error_logger and sasl\ In-Reply-To: <20050606222425.GD749@feeble.motivity.ca> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> <20050606222425.GD749@feeble.motivity.ca> Message-ID: <42A4CF24.9090506@hq.idt.net> Thanks Vance, this is helpful! Since you mentined you haven't used -heart, what approach do you use in order to auto-restart a terminated node? Serge Vance Shipley wrote: > On Mon, Jun 06, 2005 at 05:47:56PM -0400, Serge Aleynikov wrote: > } > } I see that there's some overlap in functionality of how the emulator can > } be started in production. Two ways are mentioned in the docs: > } > } 1. erl -detached -heart ... > } 2. run_erl -daemon ... > > The emulator itself is an executable named "beam". We always run > it by calling the program named "erl" as it does a lot of stuff we > don't care to know about. The "erl" program has a number of options > to control how it behaves, some of which are useful in an embedded > system. The "run_erl" program is a front end for "erl" which handles > some of the issues inherent in an embedded system. > > So I think that there is no overlap, run_erl provides yet more > functionality over erl. > > } I believe the second feature is superseded by ^G command in the erl > } shell, where it is possible to connect a shell to a remote node (or is > } to_erl still preferable because it can really get access to the same > } console that started the node?). > > The group leader for a process defines where the "tty" output goes. > If you use run_erl it receives all of this and logs it as well as > allowing you to connect and use the real console. I have no idea > what happens to the group leader when you run -detached. > > } I was a bit hesitant to use run_erl because I wasn't sure if it could be > } reliably combined with the -heart option of starting the emulator. > > I've not used heart yet. > > } Would it be safe to do something like this in production: > } > } HEART_COMMAND= \ > } run_erl -daemon pipe_dir/ log_dir "erl -heart [command_arguments]" > > The way you would normally start an embeded system is with is with > ~/lib/erlang/bin/start. You may add -heart to the command line > options there: > > $ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA -heart heart_command" > > } In this case does the "erl" need to have any of the following: -detached > } -noshell? > > No! You definetly don't want those as you will be using the > console shell. You may want to use some of the other options > though: > > $ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA +A32 +Bi -sname embedded" > > } Upon examining a few projects (eddie, yaws, etc.) I saw that production > } systems are started using the "erl -detached ..." as opposed to run_erl > } method. Is it because it's more portable (i.e. run_erl is Linux/Solaris > } specific)? > > The embedded system stuff was originally only targeted for Solaris > and as such other OS users had to come up with their own. I assume > that is what happened with Eddie. The situation today is much better, > the embedded tools work with Solaris, FreeBSD, OS X and that other > *nix. With yaws I think it's to minimize the OTP dependence. > > -Vance From ulf@REDACTED Tue Jun 7 00:57:15 2005 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 07 Jun 2005 00:57:15 +0200 Subject: error_logger and sasl In-Reply-To: <42A4C48C.2060602@hq.idt.net> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> Message-ID: Den 2005-06-06 23:47:56 skrev Serge Aleynikov : > Upon examining a few projects (eddie, yaws, etc.) I saw that production > systems are started using the "erl -detached ..." as opposed to run_erl > method. Is it because it's more portable (i.e. run_erl is Linux/Solaris > specific)? AXD 301 uses run_erl, and has done so for many years. Combining run_erl and heart is no problem at all. The environment variable $HEART_COMMAND specifies a script to be run in case the erlang node dies. This script can use run_erl to start the erlang node. One issue with run_erl/to_erl is that you get into trouble if two users use to_erl simultaneously towards the same erlang node. Nothing prevents this from happening, but the results will be confusing (run_erl sends all output to the same named pipe and the two to_erl processes compete for read access.) /Uffe From vances@REDACTED Tue Jun 7 01:02:47 2005 From: vances@REDACTED (Vance Shipley) Date: Mon, 6 Jun 2005 19:02:47 -0400 Subject: error_logger and sasl\ In-Reply-To: <42A4CF24.9090506@hq.idt.net> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> <20050606222425.GD749@feeble.motivity.ca> <42A4CF24.9090506@hq.idt.net> Message-ID: <20050606230247.GE749@feeble.motivity.ca> Serge, I have never had a production Erlang/OTP node hang. This is not to say that using heart isn't a good idea. I have intentions to use the hardware watchdog timers available on the hardware I use too. I just haven't gotten around to it and since Erlang/OTP is so good to me I can't say when I will. -Vance On Mon, Jun 06, 2005 at 06:33:08PM -0400, Serge Aleynikov wrote: } } Since you mentined you haven't used -heart, what approach do you use in } order to auto-restart a terminated node? From vances@REDACTED Tue Jun 7 01:46:06 2005 From: vances@REDACTED (Vance Shipley) Date: Mon, 6 Jun 2005 19:46:06 -0400 Subject: error_logger and sasl In-Reply-To: References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> Message-ID: <20050606234606.GF749@feeble.motivity.ca> On Tue, Jun 07, 2005 at 12:57:15AM +0200, Ulf Wiger wrote: } } One issue with run_erl/to_erl is that you get into trouble } if two users use to_erl simultaneously towards the same } erlang node. Nothing prevents this from happening, but the } results will be confusing (run_erl sends all output to the } same named pipe and the two to_erl processes compete for } read access.) What I have been doing is to have normal access to the node done using "erl -sname $USER -remsh embedded@`hostname`" which has each user working in their own home directory accessing the system using their own node. Access to to_erl is then limited to those cases where it is really needed. The difference with this is that you won't see the error_logger output to tty. This may be good or bad. In one of our systems there is a lot of verbose reporting going on which would otherwise confuse the operator trying to enter commands. This may be especialy true if she is trying to take corrective actions for ongoing problems. In order to stop the errors she has to run some commands. Being free from the error reports coming out on the screen makes this much easier. At other times we want to see some or all of the error_logger reports. For this I wrote an event handler for the error_logger which forwards specified report types to a remote error_logger process. When a user wants to see, for example, error_report & info_report messages generated on embedded@REDACTED sent to the error_logger process running on user@REDACTED: (user@REDACTED)1> gen_event:add_handler({error_logger, 'embedded@REDACTED'}, forward_error_logger, [[error_report, info_report], whereis(error_logger)]). This causes the forward_error_logger handler to be installed at embedded@REDACTED and the error_report & info_report reports to (also) be sent to the local error_logger at user@REDACTED Of course I also put that into a simple command in a user_default module so the user only needs to do: (user@REDACTED)1> log(sasl). ok -Vance From vances@REDACTED Tue Jun 7 02:06:01 2005 From: vances@REDACTED (Vance Shipley) Date: Mon, 6 Jun 2005 20:06:01 -0400 Subject: error_logger and sasl In-Reply-To: <20050606234606.GF749@feeble.motivity.ca> References: <429FB7C5.3000106@hq.idt.net> <20050606195337.GB25436@hyber.org> <20050606212105.GA749@feeble.motivity.ca> <42A4C48C.2060602@hq.idt.net> <20050606234606.GF749@feeble.motivity.ca> Message-ID: <20050607000600.GG749@feeble.motivity.ca> Another problem is that the SASL report browser makes the assumption that you are on the console. If you access a node remotely and try and use it you will get suprising results. I patched it so that it sends responses to the requestor. http://article.gmane.org/gmane.comp.lang.erlang.general/6862 -Vance From ingela@REDACTED Tue Jun 7 12:31:23 2005 From: ingela@REDACTED (Ingela Anderton) Date: Tue, 7 Jun 2005 12:31:23 +0200 Subject: Using inets http client References: <200506041830.44582.will@misconception.org.uk> Message-ID: <17061.30587.660159.719475@gargle.gargle.HOWL> Sorry for not being quite as quick to answer as Michael but yesterday was a new Swedish national holiday, so I have not read my mail since Friday. What you are doing wrong is that your functions below is not tail-recursive. An erlang function always returns the value of its last statement. So the first time around you do receive the response as you expect but instead of returning it it will be thrown away and you call http_wait_with_timeout again! Try writing your function like this instead: http_wait_with_timeout(RequestId, Timeout) -> if Timeout > 0 -> receive {http, {RequestId, Result}} -> Result; {http, {RequestId, {error, Reason}}} -> throw({error, Reason}) after 1000 -> http_wait_with_timeout(RequestId, Timeout - 1000) end; true -> throw({timeout}) end. By the way are you aware that you can let the http-client handle the timeout part and if the timeout occurs your process will receive the message {http, RequestId, {error, timeout}}! Call to the client would look like this: http:request(get, {Url, []}, [{timeout, 10000}], [{sync, false}]) Will Newton wrote: > > Following the documentation of the inets http client I have written this code: > > http_wait_with_timeout(RequestId, Timeout) -> > if > Timeout > 0 -> > receive > {http, {RequestId, Result}} -> > Result; > {http, {RequestId, {error, Reason}}} -> > throw({error, Reason}) > after > 1000 -> > io:format(".") > end, > http_wait_with_timeout(RequestId, Timeout - 1000); > true -> > throw({timeout}) > end. > > get_url(Url) -> > application:start(inets), > case http:request(get, {Url, []}, [], [{sync, false}]) of > {ok, RequestId} -> > http_wait_with_timeout(RequestId, 15000); > _ -> > io:format("http request failed~n") > end. > > I get a series of periods printed but I never get the expected response from > the async http request. Can anyone tell me what am I doing wrong? > > Thanks, -- /Ingela - OTP team From klacke@REDACTED Tue Jun 7 12:29:14 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Tue, 7 Jun 2005 12:29:14 +0200 Subject: Yaws + SSL in non Win32 OS In-Reply-To: <027c01c56acd$42129080$4a00a8c0@Inswitch251> References: <02af01c567b2$bb0fed70$4a00a8c0@Inswitch251> <20050606191841.GA25436@hyber.org> <027c01c56acd$42129080$4a00a8c0@Inswitch251> Message-ID: <20050607102914.GA5415@hyber.org> On Mon, Jun 06, 2005 at 04:23:40PM -0300, Inswitch Solutions wrote: > Hi Klacke, > > I can't find the patch you mention, please could you give the URL to > download it? > --- esock.c~ 2004-09-14 14:02:44.000000000 +0200 +++ esock.c 2005-04-07 11:25:43.068624336 +0200 @@ -138,7 +138,7 @@ #define MAJOR_VERSION 2 #define MINOR_VERSION 0 #define MAXREPLYBUF 256 -#define RWBUFLEN 4096 +#define RWBUFLEN (32*1024) #define IS_CLIENT 0 #define IS_SERVER 1 #define SELECT_TIMEOUT 2 /* seconds */ /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From bengt.kleberg@REDACTED Tue Jun 7 13:11:59 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 07 Jun 2005 13:11:59 +0200 Subject: exit in fun running via timer:apply_interval/4 In-Reply-To: <6016e20aba8715cab5e92429ccff4df6@acm.org> References: <6016e20aba8715cab5e92429ccff4df6@acm.org> Message-ID: <42A580FF.8070508@ericsson.com> On 2005-06-03 20:53, Reto Kramer wrote: > Folks, > > I'm looking for the best (elegant) way to make sure that if there's an > exit in the Mod:Fun that I run via timer:apply_interval/4, the "parent" > process (the one that scheduled the timer) will receive the exit > message, so I can programmatically react to it (and e.g. shutdown my > system). > > I'm sure someone out there has an elegant solution. i do not have a solution. instead i have a follow-up question: what does the following from the man page of the timer module mean? An interval timer, i.e. a timer created by evaluating any of the func- tions apply_interval/4, send_interval/3, and send_interval/2, is linked to the process towards which the timer performs its task. i interpreted it to mean that the process that called timer:apply_interval will be linked to the (temporary) process doing the module:function() supplied as argument to apply_interval/4. this is not the case, so what does it really mean? who is linked, and to whom? bengt, who has included a little test module to play with when investigating this problem. -module(interval). -export([main/1, crashing/0]). main(_) -> timer:apply_interval(1000, interval, crashing, []), loop(0), init:stop(). crashing() -> io:fwrite("~w~n", [erlang:self()]), erlang:exit(crashing). loop(N) -> receive Something -> io:fwrite("~w~n", [Something]) after 500 -> io:fwrite("~w~n", [N]) end, loop(N+1). From ulf.wiger@REDACTED Tue Jun 7 14:00:18 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 7 Jun 2005 14:00:18 +0200 Subject: Erlang/OTP listed at ACM/SIGMOD Message-ID: I came across the ACM SIGMOD list of publicly available database software. Erlang/OTP is now listed under the 'commercial' section: http://www.sigmod.org/sigmod/databaseSoftware/commercial/ /Uffe From will@REDACTED Tue Jun 7 14:17:51 2005 From: will@REDACTED (Will Newton) Date: Tue, 7 Jun 2005 13:17:51 +0100 Subject: Using inets http client In-Reply-To: <17061.30587.660159.719475@gargle.gargle.HOWL> References: <200506041830.44582.will@misconception.org.uk> <17061.30587.660159.719475@gargle.gargle.HOWL> Message-ID: <200506071317.51623.will@misconception.org.uk> On Tuesday 07 June 2005 11:31, Ingela Anderton wrote: > Sorry for not being quite as quick to answer as Michael but yesterday > was a new Swedish national holiday, so I have not read my mail > since Friday. Thanks, I'm glad you could shed some light on the issue. My code is working now based on your explanation. > By the way are you aware that you can let the http-client handle > the timeout part and if the timeout occurs your process > will receive the message {http, RequestId, {error, timeout}}! > > Call to the client would look like this: > http:request(get, {Url, []}, [{timeout, 10000}], [{sync, false}]) Yes, I am not sure whether I'm doing things in the correct manner. I'm quite new to Erlang and not really familiar with the patterns of how to manage concurrency. I'm writing a command line tool, so I wanted to make it appear as interactive as possible and give feedback during the timeout (printing the dots). There may be a better way to do this - another process could print the dots and be signalled by the http request handler to finish for example. From ingela@REDACTED Tue Jun 7 14:52:39 2005 From: ingela@REDACTED (Ingela Anderton) Date: Tue, 7 Jun 2005 14:52:39 +0200 Subject: Using inets http client References: <200506041830.44582.will@misconception.org.uk> <20050604193758.GJ12205@fangora.autosys.us> <200506050324.04074.will@misconception.org.uk> <20050605044812.GM12205@fangora.autosys.us> Message-ID: <17061.39063.523166.312955@gargle.gargle.HOWL> Michael McDaniel wrote: > > > I suggest adding > > > io:format'~p~n', [RequestId]) , > > > > > > just before the call to http_wait_with_timeout(RequestId, 15000) in > > > get_url/1 and see what gets printed. > > > > #Ref<0.0.0.68> > > > > I'm not sure how to interpret this value... > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This value should not be interpreted. It is an erlang reference as returned by the bif make_ref(). You should only use this value to pattern match against response messages from the http-client to be able to differentiate between responses if your process makes several asynchronous request before receiving the responses. -- /m.v.h Ingela - OTP team From chas@REDACTED Tue Jun 7 17:03:36 2005 From: chas@REDACTED (Charles Blair) Date: Tue, 7 Jun 2005 10:03:36 -0500 Subject: bad match question In-Reply-To: References: Message-ID: <20050607150336.GC1204@jump.lib.uchicago.edu> i'm curious why the bad match here isn't caught until runtime: -module(test). -compile([export_all]). start() -> Test = [a, b, c], Test = [1, 2, 3]. thanks. From matthias@REDACTED Tue Jun 7 17:21:11 2005 From: matthias@REDACTED (Matthias Lang) Date: Tue, 7 Jun 2005 17:21:11 +0200 Subject: bad match question In-Reply-To: <20050607150336.GC1204@jump.lib.uchicago.edu> References: <20050607150336.GC1204@jump.lib.uchicago.edu> Message-ID: <17061.47975.413602.795470@antilipe.corelatus.se> Charles Blair writes: > i'm curious why the bad match here isn't caught until runtime: > > -module(test). > -compile([export_all]). > > start() -> > Test = [a, b, c], > Test = [1, 2, 3]. The above code _must_ generate a badmatch at runtime, such are Erlang's semantics. A sufficiently smart compiler could choose to generate the same code as it would have generated for start() -> exit({badmatch, [1, 2, 3]}). And yes, it would be nice if the compiler generated a warning for your code, but it doesn't. The dialyzer probably does (I haven't tried). Matthias From francesco@REDACTED Tue Jun 7 17:30:45 2005 From: francesco@REDACTED (Francesco Cesarini (Erlang Training & Consulting)) Date: Tue, 07 Jun 2005 16:30:45 +0100 Subject: bad match question In-Reply-To: <20050607150336.GC1204@jump.lib.uchicago.edu> References: <20050607150336.GC1204@jump.lib.uchicago.edu> Message-ID: <42A5BDA5.9000203@erlang-consulting.com> Hi Charles, it has to do with the properties of Erlang. Matching is used for three things, * Assignment * Comparison for choice of branch in function / case / receive clauses * Extraction of data from complex data types In your example, the first instance is assignment, the second is comparison. And crashing when a match in a function clause fails is Erlang's semantical behavior. A possibility would be a compiler warning (Many were added in R10), but the code should still compile and execute. Regards, Francesco -- http://www.erlang-consulting.com Charles Blair wrote: > i'm curious why the bad match here isn't caught until runtime: > > -module(test). > -compile([export_all]). > > start() -> > Test = [a, b, c], > Test = [1, 2, 3]. > > thanks. > > From chas@REDACTED Tue Jun 7 19:09:43 2005 From: chas@REDACTED (Charles Blair) Date: Tue, 7 Jun 2005 12:09:43 -0500 Subject: bad match question In-Reply-To: <17061.47975.413602.795470@antilipe.corelatus.se> References: <20050607150336.GC1204@jump.lib.uchicago.edu> <17061.47975.413602.795470@antilipe.corelatus.se> Message-ID: <20050607170943.GH1204@jump.lib.uchicago.edu> > And yes, it would be nice if the compiler generated a warning for your > code, but it doesn't. The dialyzer probably does (I haven't tried). it doesn't (i tried before posting). thanks for your response. From chas@REDACTED Tue Jun 7 19:11:19 2005 From: chas@REDACTED (Charles Blair) Date: Tue, 7 Jun 2005 12:11:19 -0500 Subject: bad match question In-Reply-To: <42A5BDA5.9000203@erlang-consulting.com> References: <20050607150336.GC1204@jump.lib.uchicago.edu> <42A5BDA5.9000203@erlang-consulting.com> Message-ID: <20050607171119.GI1204@jump.lib.uchicago.edu> > * Comparison for choice of branch in function / case / receive clauses > In your example, the first instance is assignment, the second is > comparison. ah ... this makes sense. thanks. From Tobias.Lindahl@REDACTED Tue Jun 7 19:27:05 2005 From: Tobias.Lindahl@REDACTED (Tobias Lindahl) Date: Tue, 07 Jun 2005 19:27:05 +0200 Subject: bad match question In-Reply-To: <20050607170943.GH1204@jump.lib.uchicago.edu> References: <20050607150336.GC1204@jump.lib.uchicago.edu> <17061.47975.413602.795470@antilipe.corelatus.se> <20050607170943.GH1204@jump.lib.uchicago.edu> Message-ID: <42A5D8E9.1030501@it.uu.se> Charles Blair wrote: >>And yes, it would be nice if the compiler generated a warning for your >>code, but it doesn't. The dialyzer probably does (I haven't tried). > > > it doesn't (i tried before posting). thanks for your response. In some sense the bug is too easy to find so Dialyzer misses it ;) Dialyzer is working on an internal code format of the HiPE compiler, and among other things this means that some compiler (HiPE compiler, that is) optimizations have already occured when Dialyzer gets the code. One of these things is a constant propagation. Unfortunately the constant propagation discovers the badmatch and removes the matching completely, leaving code to throw the appropriate exception (in order to preserve the behaviour from the BEAM compiler). Dialyzer then finds that the function can never return and warns about this, but it will not find the matching that cannot succeed, because it is simply not there. Best, Tobias From mfs@REDACTED Tue Jun 7 23:33:11 2005 From: mfs@REDACTED (Mark Scandariato) Date: Tue, 7 Jun 2005 17:33:11 -0400 Subject: exit in fun running via timer:apply_interval/4 In-Reply-To: <42A580FF.8070508@ericsson.com> References: <6016e20aba8715cab5e92429ccff4df6@acm.org> <42A580FF.8070508@ericsson.com> Message-ID: On Jun 7, 2005, at 7:11 AM, Bengt Kleberg wrote: > On 2005-06-03 20:53, Reto Kramer wrote: >> Folks, >> I'm looking for the best (elegant) way to make sure that if there's >> an exit in the Mod:Fun that I run via timer:apply_interval/4, the >> "parent" process (the one that scheduled the timer) will receive the >> exit message, so I can programmatically react to it (and e.g. >> shutdown my system). >> I'm sure someone out there has an elegant solution. > > i do not have a solution. instead i have a follow-up question: > > what does the following from the man page of the timer module mean? > > An interval timer, i.e. a timer created by evaluating any of > the func- > tions apply_interval/4, send_interval/3, and send_interval/2, > is linked > to the process towards which the timer performs its task. > > i interpreted it to mean that the process that called > timer:apply_interval will be linked to the (temporary) process doing > the module:function() supplied as argument to apply_interval/4. > this is not the case, so what does it really mean? > who is linked, and to whom? > The caller of timer:apply_interval is linked to the timer_server process - when the caller exits, the timer is deleted. If you pass the pid of the caller to the function, it could be notified. Something like this: -module(foo). -export([main/0, tick/3]). action(Arg) -> whatever. tick(Parent, Ref, Arg) -> try action(Arg) catch exit:Reason -> Parent ! {Ref, Reason} end. main() -> Ref = make_ref(), timer:apply_interval(100, foo, tick, [self(), Ref, Arg]), receive {Ref, Reason} -> whatever end. On the other hand, if you're that concerned about the execution of the function, you might want to rethink the use of apply_interval. Mark. > > bengt, who has included a little test module to play with when > investigating this problem. > > > -module(interval). > -export([main/1, crashing/0]). > > > main(_) -> > timer:apply_interval(1000, interval, crashing, []), > loop(0), > init:stop(). > > crashing() -> > io:fwrite("~w~n", [erlang:self()]), > erlang:exit(crashing). > > loop(N) -> > receive > Something -> > io:fwrite("~w~n", [Something]) > after 500 -> > io:fwrite("~w~n", [N]) > end, > loop(N+1). > From kramer@REDACTED Wed Jun 8 01:31:59 2005 From: kramer@REDACTED (Reto Kramer) Date: Tue, 7 Jun 2005 16:31:59 -0700 Subject: exit in fun running via timer:apply_interval/4 In-Reply-To: References: <6016e20aba8715cab5e92429ccff4df6@acm.org> <42A580FF.8070508@ericsson.com> Message-ID: <49f170d43af96062b356a1ffc46d3043@acm.org> Thanks Mark and Bengt! I've settled on casting a message to a gen_server triggered by a timer on a regular basis. That way the code in the apply_interval is trivial and I simply don't worry about it breaking. Should the processing of the message that the timer casts break then gen_server will crash and the exit from that activity will infect the rest of the system as desired. - Reto On Jun 7, 2005, at 2:33 PM, Mark Scandariato wrote: > > On Jun 7, 2005, at 7:11 AM, Bengt Kleberg wrote: > >> On 2005-06-03 20:53, Reto Kramer wrote: >>> Folks, >>> I'm looking for the best (elegant) way to make sure that if there's >>> an exit in the Mod:Fun that I run via timer:apply_interval/4, the >>> "parent" process (the one that scheduled the timer) will receive the >>> exit message, so I can programmatically react to it (and e.g. >>> shutdown my system). >>> I'm sure someone out there has an elegant solution. >> >> i do not have a solution. instead i have a follow-up question: >> >> what does the following from the man page of the timer module mean? >> >> An interval timer, i.e. a timer created by evaluating any of >> the func- >> tions apply_interval/4, send_interval/3, and send_interval/2, >> is linked >> to the process towards which the timer performs its task. >> >> i interpreted it to mean that the process that called >> timer:apply_interval will be linked to the (temporary) process doing >> the module:function() supplied as argument to apply_interval/4. >> this is not the case, so what does it really mean? >> who is linked, and to whom? >> > > The caller of timer:apply_interval is linked to the timer_server > process - when the caller exits, the timer is deleted. > > If you pass the pid of the caller to the function, it could be > notified. Something like this: > > > -module(foo). > -export([main/0, tick/3]). > > action(Arg) -> whatever. > > tick(Parent, Ref, Arg) -> > try action(Arg) > catch > exit:Reason -> Parent ! {Ref, Reason} > end. > > main() -> > Ref = make_ref(), > timer:apply_interval(100, foo, tick, [self(), Ref, Arg]), > receive > {Ref, Reason} -> whatever > end. > > > On the other hand, if you're that concerned about the execution of the > function, you might want to rethink the use of apply_interval. > > Mark. > >> >> bengt, who has included a little test module to play with when >> investigating this problem. >> >> >> -module(interval). >> -export([main/1, crashing/0]). >> >> >> main(_) -> >> timer:apply_interval(1000, interval, crashing, []), >> loop(0), >> init:stop(). >> >> crashing() -> >> io:fwrite("~w~n", [erlang:self()]), >> erlang:exit(crashing). >> >> loop(N) -> >> receive >> Something -> >> io:fwrite("~w~n", [Something]) >> after 500 -> >> io:fwrite("~w~n", [N]) >> end, >> loop(N+1). >> > From casper2000a@REDACTED Wed Jun 8 06:21:17 2005 From: casper2000a@REDACTED (Casper) Date: Wed, 8 Jun 2005 10:21:17 +0600 Subject: Yaws Parameter pass between out/1 Message-ID: Hi All, In yaws, can I pass parameters between out/1 calls? What I tried below doesn't work. I tried to use #arg.state to pass data from first out/1 call to the second out/1. Please explain how to do it right. out(A) -> io:fwrite("State1: ~p~n", [A#arg.state]), {get_more, A#arg.cont, "Testing"}. out(A) -> io:fwrite("State2: ~p~n", [A#arg.state]), {html, "Funky Stuff"}. Thanks in advance! - Eranga From chandrashekhar.mullaparthi@REDACTED Wed Jun 8 10:42:37 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 8 Jun 2005 09:42:37 +0100 Subject: ESense 1.3 released In-Reply-To: References: Message-ID: <0867b8cd907c19d19952e5a284600b67@t-mobile.co.uk> Hi Tamas, Very useful utility! Thank you. I've managed to get this working with Emacs on Mac OS X. I've had to upgrade Emacs from 21.3 to 22.0.50.1 as the previous version crashes when tooltips are used. I got this version of "Carbonised" Emacs from http://home.att.ne.jp/alpha/z123/emacs-mac-e.html For some modules in the cosNotification application, the esense.erl generate_module/2 function crashes. I modified the code slightly to put in some traces. The problem seems to be some funny character in the module name. Item number 23 in the list below is not a printable Ascii character and that is what seems to be causing problems. I haven't spent time finding out the exact cause of this. Module#module.name = [67,111,115,78,111,116,105,102,121,67,104,97,110,110,101,108,65,100,109, 105,110,95,173,83,116,114,117,99,116,117,114,101,100,80,114,111,120,121, 80,117,115,104,83,117,112,112,108,105,101,114] 5> io:format("~s~n", [[67,111,115,78,111,116,105,102,121,67,104,97,110,110,101,108,65,100,109 ,105,110,95,173,83,116,114,117,99,116,117,114,101,100,80,114,111,120,121 ,80,117,115,104,83,117,112,112,108,105,101,114]]). CosNotifyChannelAdmin_\255StructuredProxyPushSupplier The above isn't obvious in the print out below. Generating index for module CosNotifyChannelAdmin_?StructuredProxyPushSupplier Module -> {module,"CosNotifyChannelAdmin_?StructuredProxyPushSupplier", [{function,"disconnect_structured_push_supplier(StructuredProxyPushSuppl ier) -> ok", "disconnect_structured_push_supplier/1", undefined, "This operation cause the target object to close the connection and terminate.", ["StructuredProxyPushSupplier = #objref"], true}, {function,"resume_connection(StructuredProxyPushSupplier) -> Reply", "resume_connection/1", undefined, "If the connection with the target object have been suspended this function must be used to resume the connection. If no client have been connected or the connection is active an exception is raised.", ["StructuredProxyPullConsumer = #objref", "Reply = ok | {'EXCEPTION', #'CosNotifyChannelAdmin_ConnectionAlreadyInactive'{}} | {'EXCEPTION', #'CosNotifyChannelAdmin_NotConnected'{}}"], true}, {function,"suspend_connection(StructuredProxyPushSupplier) -> Reply", "suspend_connection/1", undefined, "This operation suspends the connection with the target object. If no connection exists or the connection already is suspended an exception is raised.", ["StructuredProxyPushSupplier = #objref", "Reply = ok | {'EXCEPTION', #'CosNotifyChannelAdmin_ConnectionAlreadyInactive'{}} | {'EXCEPTION', #'CosNotifyChannelAdmin_NotConnected'{}}"], true}, {function,"connect_structured_push_consumer(StructuredProxyPushSupplier, PushConsumer) -> Reply", "connect_structured_push_consumer/2", undefined, "This operation connects a PushConsumer to the target object. If a connection already exists or the function push_structured_event is not supported by the client object an exception is raised.", ["StructuredProxyPushSupplier = #objref", "PushConsumer = #objref", "Reply = ok | {'EXCEPTION', #'CosEventChannelAdmin_AlreadyConnected'{}} | {'EXCEPTION', #'CosEventChannelAdmin_TypeError'{}}"], true}], [], []} Path -> "/Users/chandru/R10B-4/lib/cosNotification-1.1.1/doc/html/ CosNotifyChannelAdmin_StructuredProxyPushSupplier.html" Reason -> {{badmatch,{error,einval}}, [{esense,generate_module_2,2}, {esense,generate_module,2}, {esense,parse_file,1}, {lists,foreach,2}, {esense,parse_dir,1}, {lists,foreach,2}, {esense,parse_dir,1}, {lists,foreach,2}]} cheers Chandru On 6 Jun 2005, at 07:28, Tamas Patrovics wrote: > Changes > https://sourceforge.net/project/shownotes.php? > group_id=139206&release_id=332840 > > Files > https://sourceforge.net/projects/esense/ > > Homepage > http://esense.sourceforge.net/ > > > In the README file there are some basic instructions on running ESense > with an OTP version earlier than R10B. A motivated user (an AXD > developer) is preparing a more detailed description of her experiences > on setting up ESense with OTP R9. When she sends it to me I'll put it > in the README file. > > /Tamas > From joelr1@REDACTED Wed Jun 8 10:56:30 2005 From: joelr1@REDACTED (joel reymont) Date: Wed, 8 Jun 2005 10:56:30 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws Message-ID: Folks, I?m using R10B3 and my erl crashes with a segmentation violation after roughly 1014 TCP socket connections are established to a server that I wrote. The server uses plain gen_tcp. Has this been fixed in R10B5 and how can I work around it? My understanding is that Yaws has withstood up to 80,000 connections for example. Is this to a single node or multiple nodes? Thanks, Joel -- http://wagerlabs.com/tech From laurent.picouleau@REDACTED Wed Jun 8 12:06:52 2005 From: laurent.picouleau@REDACTED (Laurent Picouleau) Date: Wed, 08 Jun 2005 11:06:52 +0100 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: Message-ID: <1118225212.2153.14.camel@localhost.localdomain> Hi Joel, On Wed, 2005-06-08 at 09:56, joel reymont wrote: > Folks, > > I?m using R10B3 and my erl crashes with a segmentation violation after > roughly 1014 TCP socket connections are established to a server that I wrote. > The server uses plain gen_tcp. You should verify if your OS put a limit on the number of file_descriptor per process. Some fixe a limit of 1024 and 1014 is closed enough to make me suspect that your hiting such a limit. > Has this been fixed in R10B5 and how can I work around it? Start several nodes, each handling less connection than the limit. Br, -- Laurent Picouleau laurent.picouleau@REDACTED From klacke@REDACTED Wed Jun 8 12:30:53 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Wed, 8 Jun 2005 12:30:53 +0200 Subject: Yaws Parameter pass between out/1 In-Reply-To: References: Message-ID: <20050608103053.GA21583@hyber.org> On Wed, Jun 08, 2005 at 10:21:17AM +0600, Casper wrote: > Hi All, > > In yaws, can I pass parameters between out/1 calls? > > What I tried below doesn't work. I tried to use #arg.state to pass data from > first out/1 call to the second out/1. Please explain how to do it right. > > out(A) -> > io:fwrite("State1: ~p~n", [A#arg.state]), > {get_more, A#arg.cont, "Testing"}. > > > out(A) -> > io:fwrite("State2: ~p~n", [A#arg.state]), > {html, "Funky Stuff"}. > > There is no explicit support for this in Yaws. It is however guaranteed that the two out/1 functions will execute inside the same process. Thus, to share state between two out/1 functions in the same .yaws file it's possible to use the process dictionary to pass data. To pass data between different out/1 functions in different .yaws file, some external thing must be used, such as a gen_server, an ets table or a mnesia table. Also, your code above looks odd. To return the {get_more ... from the first out/1 function and then have another out/1 function later will be bad. The {get_more ... construct is only used to handle large POSTs where all data from the client isn't yet available. Take a look at upload.yaws in the www directory in the src distribution or at http://yaws.hyber.org/upload0.yaws to understand this. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From tpatro@REDACTED Wed Jun 8 12:48:47 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Wed, 8 Jun 2005 12:48:47 +0200 Subject: ESense 1.3 released In-Reply-To: <0867b8cd907c19d19952e5a284600b67@t-mobile.co.uk> References: <0867b8cd907c19d19952e5a284600b67@t-mobile.co.uk> Message-ID: Hi, On 6/8/05, Chandrashekhar Mullaparthi wrote: > > For some modules in the cosNotification application, the esense.erl > generate_module/2 function crashes. It didn't crash for me, only these modules were not offered as completions. Maybe the Mac cannot create files with non-printable characters in the name? Anyway: > The problem seems to be some funny character in the > module name. Item number 23 in the list below is not a printable Ascii > character and that is what seems to be causing problems. It seems the special character comes from the HTML doc, so it's probably a bug in the official documentation. Here's a quick fix to filter out this character from the module name before storing it: --- esense-1.3/esense.erl 2005-06-06 08:01:54.000000000 +0200 +++ esense/esense.erl 2005-06-08 12:29:59.029718144 +0200 @@ -50,7 +50,9 @@ parse_html({'div', _, Text}, {module_name, Module}) -> ModuleName = string:strip(remove_newlines(string:substr(Text, 2, length(Text) - 2))), - {next_function, Module#module{name = ModuleName}}; + %% some module names contain strange characters (ASCII 173) + %% these are removed before storing the module name + {next_function, Module#module{name = [ C || C <- ModuleName, C /= 173 ]}}; Thanks for the bug report. This fix will be in the next release. /Tamas From nicolas@REDACTED Wed Jun 8 12:50:38 2005 From: nicolas@REDACTED (Nicolas Niclausse) Date: Wed, 08 Jun 2005 12:50:38 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: <1118225212.2153.14.camel@localhost.localdomain> (Laurent Picouleau's message of "Wed, 08 Jun 2005 11:06:52 +0100") References: <1118225212.2153.14.camel@localhost.localdomain> Message-ID: <7apsuxt94x.fsf@fugue.inria.fr> >>>>> "pil" == Laurent Picouleau writes: > Hi Joel, > On Wed, 2005-06-08 at 09:56, joel reymont wrote: > You should verify if your OS put a limit on the number of > file_descriptor per process. Some fixe a limit of 1024 and 1014 > is closed enough to make me suspect that your hiting such a > limit. Yes, for Linux, you can increase the limit: http://bbcr.uwaterloo.ca/~brecht/servers/openfiles.html -- Nicolas From joelr1@REDACTED Wed Jun 8 13:43:01 2005 From: joelr1@REDACTED (joel reymont) Date: Wed, 8 Jun 2005 13:43:01 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: <1118225212.2153.14.camel@localhost.localdomain> References: <1118225212.2153.14.camel@localhost.localdomain> Message-ID: The crash is AFTER I increased the number of FDs per process/user to over 10000 with ulimit -n. I am fine with starting several nodes but the 1024 sockets per node limit seems to be somewhat low. In either case I think Erlang should have complained and not crashed on me. On 6/8/05, Laurent Picouleau wrote: > > > > I?m using R10B3 and my erl crashes with a segmentation violation after > > roughly 1014 TCP socket connections are established to a server that I wrote. > > The server uses plain gen_tcp. > > You should verify if your OS put a limit on the number of > file_descriptor per process. Some fixe a limit of 1024 and 1014 is > closed enough to make me suspect that your hiting such a limit. -- http://wagerlabs.com/tech From david.nospam.hopwood@REDACTED Wed Jun 8 15:26:26 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 08 Jun 2005 14:26:26 +0100 Subject: ESense 1.3 released In-Reply-To: References: <0867b8cd907c19d19952e5a284600b67@t-mobile.co.uk> Message-ID: <42A6F202.3010701@blueyonder.co.uk> Tamas Patrovics wrote: > It seems the special character comes from the HTML doc, so it's > probably a bug in the official documentation. [...] > + %% some module names contain strange characters (ASCII 173) ASCII 173 is a soft hyphen. It should be replaced by an ordinary hyphen (U+002D HYPHEN-MINUS). -- David Hopwood From david.nospam.hopwood@REDACTED Wed Jun 8 15:47:28 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Wed, 08 Jun 2005 14:47:28 +0100 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: <1118225212.2153.14.camel@localhost.localdomain> Message-ID: <42A6F6F0.6000608@blueyonder.co.uk> joel reymont wrote: > The crash is AFTER I increased the number of FDs per process/user to > over 10000 with ulimit -n. You need to increase the system limit (e.g. on Linux, "echo 10000 > /proc/sys/fs/file-max" as root, which lasts until the next reboot) as well as the shell limit. > I am fine with starting several nodes but > the 1024 sockets per node limit seems to be somewhat low. In either > case I think Erlang should have complained and not crashed on me. I agree. Ideally it would print a message saying that the system and/or shell fd limits are the problem, with the URL of a web page on how to fix it. -- David Hopwood From olivier.sambourg@REDACTED Wed Jun 8 16:41:58 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Wed, 8 Jun 2005 16:41:58 +0200 Subject: Erlang / Javascript interface Message-ID: Hi everyone I'm currently working on a MMORPG game. The server part is pure erlang, and uses ejabberd and XMPP to send base64-encoded binary erlang data (term_to_binary) to the client (I know there must be better ways, but at least it's VERY simple for the server). On the client side, two versions co-exist : pure java (using jinterface and an XMPP library to retrieve the data) and a thin web client. I've just found a javascript XMPP library (JSJaC, which uses the infamous XMLHttpRequest object), so the final link would be the equivalent of jinterface / erl_interface for javascript (data processing only). Has anyone ever worked on something like that, or will I have to code it myself (if it's possible but so far no reason why it shouldn't be...) ? Thanks // Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Wed Jun 8 16:51:29 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 8 Jun 2005 15:51:29 +0100 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: <42A6F6F0.6000608@blueyonder.co.uk> References: <1118225212.2153.14.camel@localhost.localdomain> <42A6F6F0.6000608@blueyonder.co.uk> Message-ID: <41CCC89E-4515-4034-BD1E-6BCB5D58F00F@mac.com> > >> I am fine with starting several nodes but >> the 1024 sockets per node limit seems to be somewhat low. In either >> case I think Erlang should have complained and not crashed on me. >> > > I agree. Ideally it would print a message saying that the system > and/or > shell fd limits are the problem, with the URL of a web page on how to > fix it. It certainly does print out a relevant message in the erlang crash dump if the number of free fds is exceeded. I have seen it in the past. This seems like a bad bug somewhere. Sean From mickael.remond@REDACTED Wed Jun 8 17:07:57 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 08 Jun 2005 17:07:57 +0200 Subject: Erlang / Javascript interface In-Reply-To: References: Message-ID: <42A709CD.2090104@erlang-fr.org> Olivier Sambourg wrote: > Has anyone ever worked on something like that, or will I have to code it > myself (if it's possible but so far no reason why it shouldn't be...) ? H?ctor Rivas G?ndara has been working on ErlXPCOM. He told me that it is not totally ready yet, but this code probably does at least partly what you want. You may have to wait a little bit for the release, however. -- Micka?l R?mond From warren_chambliss@REDACTED Wed Jun 8 17:54:48 2005 From: warren_chambliss@REDACTED (warren_chambliss@REDACTED) Date: Wed, 8 Jun 2005 09:54:48 -0600 Subject: Problem With Distributed Programming Example Message-ID: Hi All, I'm trying to get up to speed with Erlang and I'm working through the "Getting Started With Erlang" document. I'm having a problem with the first distributed programming example (tut17). The message from ping to pong doesn't appear to be getting received (or possibly sent). A couple questions. - I can't get the example to work between two machines. The pong machine has a dash ('-') character in it's hostname. This causes the Erlang shell to complain with a badarith error in the start_ping() function. Is there a way to include a dash in a node name? - I can't get the example to work on a single machine using two seperate Erlang shell instances. I've tried the hostname and "localhost" for nodenames but still no luck. - What's the proper way in the tut17 example to specify nodes in dotted-quad IP notation (xx.xx.xx.xx)? - Does message passing automatically work between nodes on machines with different endianness. For example between nodes on x86 and Sparc? Sorry if these questions are fundamental, but I'm trying to get over the basic learning hump rather quickly. Thanks, Warren Chambliss From sean.hinde@REDACTED Wed Jun 8 18:15:32 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 8 Jun 2005 17:15:32 +0100 Subject: Problem With Distributed Programming Example In-Reply-To: References: Message-ID: Hi, On 8 Jun 2005, at 16:54, warren_chambliss@REDACTED wrote: > Hi All, > > I'm trying to get up to speed with Erlang and I'm working through > the "Getting Started With Erlang" document. I'm having a problem > with the first distributed programming example (tut17). The > message from ping to pong doesn't appear to be getting received (or > possibly sent). Welcome ! > > A couple questions. > > - I can't get the example to work between two machines. The pong > machine has a dash ('-') character in it's hostname. This causes > the Erlang shell to complain with a badarith error in the start_ping > () function. Is there a way to include a dash in a node name? A node name is syntactically the same as an atom. To include "funny" characters in an atom use singe quotes: 'node@REDACTED' > > - I can't get the example to work on a single machine using two > seperate Erlang shell instances. I've tried the hostname and > "localhost" for nodenames but still no luck. Check you are starting them with something like: erl -sname a@REDACTED erl -sname b@REDACTED > > - What's the proper way in the tut17 example to specify nodes in > dotted-quad IP notation (xx.xx.xx.xx)? Good question, I don't know. > > - Does message passing automatically work between nodes on machines > with different endianness. For example between nodes on x86 and > Sparc? Yes, all is beautifully transparent > > Sorry if these questions are fundamental, but I'm trying to get > over the basic learning hump rather quickly. Great. It sounds like you might be on the track of a new project. Plenty of help available on this list if you get stuck. Sean From warren_chambliss@REDACTED Wed Jun 8 18:29:46 2005 From: warren_chambliss@REDACTED (warren_chambliss@REDACTED) Date: Wed, 8 Jun 2005 10:29:46 -0600 Subject: Problem With Distributed Programming Example Message-ID: Thanks Sean! The single quotes and the extra information on the -sname parameter did the trick. Just another question for the group. Is the mailing list archive search broken? I get: Not Found The requested URL /cgi-bin/marc-search.cgi was not found on this server. - Warren Chambliss -----Original Message----- From: Sean Hinde [mailto:sean.hinde@REDACTED] Sent: Wednesday, June 08, 2005 10:16 AM To: CHAMBLISS,WARREN (A-ColSprings,ex1) Cc: erlang-questions@REDACTED Subject: Re: Problem With Distributed Programming Example Hi, On 8 Jun 2005, at 16:54, warren_chambliss@REDACTED wrote: > Hi All, > > I'm trying to get up to speed with Erlang and I'm working through > the "Getting Started With Erlang" document. I'm having a problem > with the first distributed programming example (tut17). The > message from ping to pong doesn't appear to be getting received (or > possibly sent). Welcome ! > > A couple questions. > > - I can't get the example to work between two machines. The pong > machine has a dash ('-') character in it's hostname. This causes > the Erlang shell to complain with a badarith error in the start_ping > () function. Is there a way to include a dash in a node name? A node name is syntactically the same as an atom. To include "funny" characters in an atom use singe quotes: 'node@REDACTED' > > - I can't get the example to work on a single machine using two > seperate Erlang shell instances. I've tried the hostname and > "localhost" for nodenames but still no luck. Check you are starting them with something like: erl -sname a@REDACTED erl -sname b@REDACTED > > - What's the proper way in the tut17 example to specify nodes in > dotted-quad IP notation (xx.xx.xx.xx)? Good question, I don't know. > > - Does message passing automatically work between nodes on machines > with different endianness. For example between nodes on x86 and > Sparc? Yes, all is beautifully transparent > > Sorry if these questions are fundamental, but I'm trying to get > over the basic learning hump rather quickly. Great. It sounds like you might be on the track of a new project. Plenty of help available on this list if you get stuck. Sean From sean.hinde@REDACTED Wed Jun 8 18:56:05 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 8 Jun 2005 17:56:05 +0100 Subject: Problem With Distributed Programming Example In-Reply-To: References: Message-ID: <7100C547-ED2B-4642-A6D1-C343B1804DAD@mac.com> On 8 Jun 2005, at 17:29, warren_chambliss@REDACTED wrote: > > Just another question for the group. Is the mailing list archive > search broken? I get: > > Not Found > The requested URL /cgi-bin/marc-search.cgi was not found on this > server. Someone from Ericsson will need to fix that. In the meantime there is a much better search engine for the mailing list in the forums section at www.trapexit.org. Sean From joelr1@REDACTED Tue Jun 7 13:40:09 2005 From: joelr1@REDACTED (joel reymont) Date: Tue, 7 Jun 2005 13:40:09 +0200 Subject: 1014 tcp connections and a crash Message-ID: Folks, I?m using 10RB3 and my erl crashes with a segmentation violation after roughly 1014 TCP socket connections are established to it. Is this a bug, feature or should I go with the latest version? I?m on Mac OSX 10.3.9. Thanks, Joel -- http://wagerlabs.com/tech From casper2000a@REDACTED Thu Jun 9 05:37:11 2005 From: casper2000a@REDACTED (Casper) Date: Thu, 9 Jun 2005 09:37:11 +0600 Subject: Yaws Parameter pass between out/1 In-Reply-To: <20050608103053.GA21583@hyber.org> Message-ID: Klacke, Thanks for your advice. I later found the {bindings, [{Key, Value}]}, which does exactly what I wanted. Cheers, - Eranga -----Original Message----- From: klacke@REDACTED [mailto:klacke@REDACTED] Sent: Wednesday, June 08, 2005 4:31 PM To: Casper Cc: klacke@REDACTED; erlang-questions@REDACTED Subject: Re: Yaws Parameter pass between out/1 On Wed, Jun 08, 2005 at 10:21:17AM +0600, Casper wrote: > Hi All, > > In yaws, can I pass parameters between out/1 calls? > > What I tried below doesn't work. I tried to use #arg.state to pass data from > first out/1 call to the second out/1. Please explain how to do it right. > > out(A) -> > io:fwrite("State1: ~p~n", [A#arg.state]), > {get_more, A#arg.cont, "Testing"}. > > > out(A) -> > io:fwrite("State2: ~p~n", [A#arg.state]), > {html, "Funky Stuff"}. > > There is no explicit support for this in Yaws. It is however guaranteed that the two out/1 functions will execute inside the same process. Thus, to share state between two out/1 functions in the same .yaws file it's possible to use the process dictionary to pass data. To pass data between different out/1 functions in different .yaws file, some external thing must be used, such as a gen_server, an ets table or a mnesia table. Also, your code above looks odd. To return the {get_more ... from the first out/1 function and then have another out/1 function later will be bad. The {get_more ... construct is only used to handle large POSTs where all data from the client isn't yet available. Take a look at upload.yaws in the www directory in the src distribution or at http://yaws.hyber.org/upload0.yaws to understand this. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From tpatro@REDACTED Thu Jun 9 06:54:49 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Thu, 9 Jun 2005 06:54:49 +0200 Subject: ESense 1.3 released In-Reply-To: <42A6F202.3010701@blueyonder.co.uk> References: <0867b8cd907c19d19952e5a284600b67@t-mobile.co.uk> <42A6F202.3010701@blueyonder.co.uk> Message-ID: On 6/8/05, David Hopwood wrote: > Tamas Patrovics wrote: > > It seems the special character comes from the HTML doc, so it's > > probably a bug in the official documentation. > [...] > > + %% some module names contain strange characters (ASCII 173) > > ASCII 173 is a soft hyphen. It should be replaced by an ordinary hyphen > (U+002D HYPHEN-MINUS). I think the soft hyphen is only a hint for the browser, because it does not appear on the rendered HTML page. For example, one of the modules in question appears as CosNotifyChannelAdmin_StructuredProxyPullConsumer not as CosNotifyChannelAdmin_-StructuredProxyPullConsumer. Clearly, the first one seems correct, so I guess dropping the soft hyphen is the way to go when we need the actual module name. /Tamas From yerl@REDACTED Thu Jun 9 09:26:21 2005 From: yerl@REDACTED (yerl@REDACTED) Date: Thu, 9 Jun 2005 09:26:21 +0200 Subject: Erlang code Message-ID: An HTML attachment was scrubbed... URL: From bjorn@REDACTED Thu Jun 9 11:43:58 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 09 Jun 2005 11:43:58 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: Message-ID: Could you start gdb on the core dump and run the 'where' command and email the output? That might help us to determine whether this a new or old bug. /Bjorn joel reymont writes: > Folks, > > I?m using R10B3 and my erl crashes with a segmentation violation after > roughly 1014 TCP socket connections are established to a server that I wrote. > The server uses plain gen_tcp. > > Has this been fixed in R10B5 and how can I work around it? My understanding > is that Yaws has withstood up to 80,000 connections for example. Is > this to a single > node or multiple nodes? > > Thanks, Joel > > > -- > http://wagerlabs.com/tech > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From klacke@REDACTED Thu Jun 9 13:54:40 2005 From: klacke@REDACTED (klacke@REDACTED) Date: Thu, 9 Jun 2005 13:54:40 +0200 Subject: 1014 tcp connections and a crash In-Reply-To: References: Message-ID: <20050609115440.GA4938@hyber.org> On Tue, Jun 07, 2005 at 01:40:09PM +0200, joel reymont wrote: > Folks, > > I?m using 10RB3 and my erl crashes with a segmentation violation after > roughly 1014 TCP socket connections are established to it. Is this a > bug, feature or should I go with the latest version? I?m on Mac OSX > 10.3.9. > 10.3, isn't that where poll is emulated by select(). It could be that the fd_sets just get silently overflowed. Try to write a normal C program that open +1024 sockets What is FD_SETSIZE set to in the header files. /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From joelr1@REDACTED Thu Jun 9 14:07:02 2005 From: joelr1@REDACTED (joel reymont) Date: Thu, 9 Jun 2005 14:07:02 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: Message-ID: I will do this over the weekend. I compiled myself the R10B5 version just for the purpose. On 09 Jun 2005 11:43:58 +0200, Bjorn Gustavsson wrote: > Could you start gdb on the core dump and run the 'where' command > and email the output? That might help us to determine whether > this a new or old bug. -- http://wagerlabs.com/tech From bjorn@REDACTED Thu Jun 9 14:09:19 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 09 Jun 2005 14:09:19 +0200 Subject: 1014 tcp connections and a crash In-Reply-To: <20050609115440.GA4938@hyber.org> References: <20050609115440.GA4938@hyber.org> Message-ID: Yes, poll() is indeed emulated with select() on Mac OS 10.3.9, and the bug could actually be in the poll() emulation code. In R10B-6, select() will be used on both Mac OS 10.3 and Mac OS 10.4. (There is a poll() on Mac OS 10.4, but it doesn't handle devices.) What I have done is to change configure to revert to select() if poll() is either emulated by select() or doesn't handle devices. /Bjorn klacke@REDACTED writes: > On Tue, Jun 07, 2005 at 01:40:09PM +0200, joel reymont wrote: > > Folks, > > > > I?m using 10RB3 and my erl crashes with a segmentation violation after > > roughly 1014 TCP socket connections are established to it. Is this a > > bug, feature or should I go with the latest version? I?m on Mac OSX > > 10.3.9. > > > > 10.3, isn't that where poll is emulated by select(). > It could be that the fd_sets just get silently overflowed. > > Try to write a normal C program that open +1024 sockets > > What is FD_SETSIZE set to in the header files. > > > /klacke > > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From serge@REDACTED Wed Jun 8 22:25:02 2005 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 08 Jun 2005 16:25:02 -0400 Subject: snmp traps Message-ID: <42A7541E.7080501@hq.idt.net> Hi, I am somewhat struggling with the documentation of SNMP traps. Can someone explain to me the meaning of some parameters in the SNMP's config files? notify.conf {NotifyName, Tag, Type}. - What is Tag used for? target_addr.conf {TargetName,Ip,Udp,Timeout,RetryCount,TagList,ParamsName,EngineId, TMask, MaxMessageSize}. - What are TagList and TMask? Also, the os_mon application supports OTP-OS-MON-MIB mib. Can it automatically send traps described in the mib when corresponding alarms are set, or is it a responsibility of a programmer to write and install an alarm handler and convert alarm events into appropriate traps? In order to test an ability to send traps, I verified that I could do so by running: ~~>snmptrap -c public -v2c 169.132.9.113 uptime loadSystemMemoryHighAlarm However after configuring and starting the SNMP agent, this doesn't seem to deliver traps to the manager at 169.132.9.113: 10> snmp_notification_mib:add_notify("test", "sample test", trap). {ok,"test"} 11> snmp_target_mib:add_addr("test", [169,132,9,113], 162, 5000, 3, "sample test", "", "", "", 2048). {ok,"test"} 12> snmp:send_notification(snmp_master_agent, loadSystemMemoryHighAlarm, no_receiver, "test", []). {send_trap,loadSystemMemoryHighAlarm,"test",[],no_receiver,[]} Thanks. Serge From serge@REDACTED Thu Jun 9 13:29:56 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 09 Jun 2005 07:29:56 -0400 Subject: snmp traps Message-ID: <42A82834.7080108@hq.idt.net> Hi, I am somewhat struggling with the documentation of SNMP traps. Can someone explain to me the meaning of some parameters in the SNMP's config files? notify.conf {NotifyName, Tag, Type}. - What is the Tag used for? target_addr.conf {TargetName,Ip,Udp,Timeout,RetryCount,TagList,ParamsName,EngineId, TMask, MaxMessageSize}. - What are TagList and TMask? Also, the os_mon application supports OTP-OS-MON-MIB mib. Can it automatically send traps described in the mib when corresponding alarms are set, or is it a responsibility of a programmer to write and install an alarm handler and convert alarm events into appropriate traps? In order to test an ability to send traps, I verified that I could do so by running: ~~>snmptrap -c public -v2c 169.132.9.113 uptime loadSystemMemoryHighAlarm However after configuring and starting the SNMP agent, the commands below don't seem to deliver traps to the manager at 169.132.9.113: 10> snmp_notification_mib:add_notify("test", "sample test", trap). {ok,"test"} 11> snmp_target_mib:add_addr("test", [169,132,9,113], 162, 5000, 3, "sample test", "", "", "", 2048). {ok,"test"} 12> snmp:send_notification(snmp_master_agent, loadSystemMemoryHighAlarm, no_receiver, "test", []). {send_trap,loadSystemMemoryHighAlarm,"test",[],no_receiver,[]} Am I using the right notation for sending notifications? Thanks. Serge From nick@REDACTED Thu Jun 9 23:42:04 2005 From: nick@REDACTED (Niclas Eklund) Date: Thu, 9 Jun 2005 23:42:04 +0200 (MEST) Subject: ESense 1.3 released In-Reply-To: Message-ID: Hello! Since Erlang supports a "flat" name space and the CORBA (OMG) standard is based on Object Oriented languages, it's neccessary for Orber (the ORB) and IC (the IDL compiler) to use this solution. Well, a similar solution as the Java packages would have made things a lot easier. But, I'm affraid that the solution arrived far to late. This resulted in module names, based on the OMG specifications, that exceeded the maximum length accepted by the "document builder". Hence, to be able to generate the documentation (html, pdf etc), we added a "break" that would do the very same thing. My favorite is still 'CosEventDomainAdmin_EventDomainFactory'. But, on the other hand, compared with other, so called, "human readable" languages, IDL specifications are about 10% in in size compared with these languages and are far more superior when it comes to throughput. Well, CORBA is mature technology, while the competition are buzzwords. Perhaps that is the reason why a major OS vendor will use XML as their internal format?! No matter what, I hope you'll enjoy using the ODK! Best Regards, Nick > On 6/8/05, David Hopwood wrote: > > Tamas Patrovics wrote: > > > It seems the special character comes from the HTML doc, so it's > > > probably a bug in the official documentation. > > [...] > > > + %% some module names contain strange characters (ASCII 173) > > > > ASCII 173 is a soft hyphen. It should be replaced by an ordinary hyphen > > (U+002D HYPHEN-MINUS). > > I think the soft hyphen is only a hint for the browser, because it > does not appear on the rendered HTML page. > > For example, one of the modules in question appears as > > CosNotifyChannelAdmin_StructuredProxyPullConsumer > > not as > > CosNotifyChannelAdmin_-StructuredProxyPullConsumer. > > > Clearly, the first one seems correct, so I guess dropping the soft > hyphen is the way to go when we need the actual module name. > > /Tamas > _________________________________________________________________ We Are The ORBs. Resistance Is Futile. Prepare To Be Assimilated! _________________________________________________________________ This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. _________________________________________________________________ From will@REDACTED Fri Jun 10 00:16:30 2005 From: will@REDACTED (Will Newton) Date: Thu, 9 Jun 2005 23:16:30 +0100 Subject: URI escaping Message-ID: <200506092316.30424.will@misconception.org.uk> Is there any code in the OTP distribution for dealing with URIs, specifically escaping characters? From serge@REDACTED Fri Jun 10 05:07:32 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 09 Jun 2005 23:07:32 -0400 Subject: snmp traps In-Reply-To: <20050609171104.6F76546AC6@bang.trapexit.org> References: <20050609171104.6F76546AC6@bang.trapexit.org> Message-ID: <42A903F4.1070400@hq.idt.net> erlang-questions@REDACTED wrote: > I am somewhat struggling with the documentation of SNMP traps. Can someone explain to me the meaning of some parameters in the SNMP's config files? > > notify.conf > {NotifyName, Tag, Type}. > > - What is the Tag used for? Tag is described in the mibs: SNMP-TARGET-MIB::SnmpTagValue SNMP-NOTIFICATION-MIB::snmpNotifyTag > target_addr.conf > {TargetName,Ip,Udp,Timeout,RetryCount,TagList,ParamsName,EngineId, > TMask, MaxMessageSize}. > > - What are TagList and TMask? TagList is described in the mib: SNMP-TARGET-MIB::SnmpTagList SNMP-TARGET-MIB::snmpTargetAddrTagList I am still not sure what TMask stands for... > Also, the os_mon application supports OTP-OS-MON-MIB mib. Can it automatically send traps described in the mib when corresponding alarms are set, or is it a responsibility of a programmer to write and install an alarm handler and convert alarm events into appropriate traps? ??? > In order to test an ability to send traps, I verified that I could do so by running: > > ~>snmptrap -c public -v2c 169.132.9.113 uptime loadSystemMemoryHighAlarm > > However after configuring and starting the SNMP agent, the commands below don't seem to deliver traps to the manager at 169.132.9.113: > > 10> snmp_notification_mib:add_notify("test", "sample test", trap). > {ok,"test"} > 11> snmp_target_mib:add_addr("test", [169,132,9,113], 162, 5000, 3, "sample test", "", "", "", 2048). > {ok,"test"} > 12> snmp:send_notification(snmp_master_agent, loadSystemMemoryHighAlarm, no_receiver, "test", []). > {send_trap,loadSystemMemoryHighAlarm,"test",[],no_receiver,[]} One more point to remember - Tags shouldn't have spaces, tags, LR and CR in them, so this is more appropriate: snmp_notification_mib:add_notify("test", "sample_test", trap). However, even with this syntax traps still don't get sent. Continuing to explore... Serge From mikael.karlsson@REDACTED Fri Jun 10 10:44:18 2005 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Fri, 10 Jun 2005 10:44:18 +0200 Subject: Implementing XPCOM objects in Erlang. (Modificado por =?iso-8859-1?q?H=E9ctor=20Rivas?= =?iso-8859-1?q?=20G=E1ndara?=) In-Reply-To: <175b6abab905bfbec99bcd3a33afd735@wanadoo.es> References: <175b6abab905bfbec99bcd3a33afd735@wanadoo.es> Message-ID: <200506101044.18690.mikael.karlsson@creado.com> Is it possible to make use of Erlangs Corba support? The ic (idl compiler) could maybe be patched for XPIDL and orber used for resolving ObjectReference -> PiD ? Mikael tisdag 31 maj 2005 17:21 skrev H?ctor Rivas G?ndara: > El 31/05/2005, a las 14:50, Ulf Wiger (AL/EAB) escribi?: > > Why do you want to make the gen_server reentrant > > in the first place? > > I'm developing the Erlang XPCOM binding. XPCOM is component tecnology > similar to COM used in Mozilla internals. A lot of interfaces of > mozilla receives an object as parameter and execute callbacks on it. > > My first option was implement the component instances as processes. > > > Another way to implement objects is to provide a module > > with a set of APIs that operate on an abstract data type. > > That's the other option. > > If the object is readonly or it will be accesed only by the C++ side > (the C++ will never do concurrent calls), there is no problem, but > there are some otherwise: > > - The object will occasionally be passed to the XPCOM side (in C++). > - so a reference to it must be created and the object will be stored > in an ORB to allow the C++ side reference it. > - I can't known when the C++ side (or even a local process) will call > the object and change the object state. > > I mean, I can't control the object access to follow the single > assignment rules. > > One solution can be create an "object dictionary" with entries like > ObjectReference-ObjectState. > > But this have more problems: > - the object support concurrent access (from C++, from Erlang > processes) and > - must allow reentrant calls. > > To solve the first I could add some logic to the Object Dictionary to > allow lock the object state until a running method does not returns > (simulate synchronized methods). > But then it is not reentrant, so I should use a monitored lock (the > actual process can do reentrant calls). > But now I have other problem: If I use a monitored lock the > XPCOM-Erlang binding must offer thread consistency (there is a call > from Erlang to C++ and back to erlang again, the process must be the > same) > > ... > Too complex all. :-/ > > Anyway, I probably would allow the two options by setting an option in > the object creation function. The programmer can choose: > - use process objects if the object is not readonly and will be accesed > by C++ and Erlang > - use record objects if the object is readonly or only accesed by the > C++ side. > > I've implemented my behaviour with callbacks like: > > method(MethodName, InParams, From, State) -> {Reply, NewState} > Reply = {ok, OutParams} | noreply | {error, Reason}. > > The objects implemented with this callbacks could be easily run with > records by simply change the behaviour code: I only need a dictionary > that could translate ObjectRefence -> {data, ObjectData} | {process, > ObjectPid}. > > > Please, comments / suggestions? > > -- > Greets From keymon@REDACTED Fri Jun 10 10:57:27 2005 From: keymon@REDACTED (=?ISO-8859-1?Q?H=E9ctor_Rivas_G=E1ndara?=) Date: Fri, 10 Jun 2005 10:57:27 +0200 Subject: =?ISO-8859-1?Q?Re:_Implementing_XPCOM_objects_in_Erlang.__=28Mod?= =?ISO-8859-1?Q?ificado_por_H=E9ctor_Rivas_G=E1ndara=29?= In-Reply-To: <200506101044.18690.mikael.karlsson@creado.com> References: <175b6abab905bfbec99bcd3a33afd735@wanadoo.es> <200506101044.18690.mikael.karlsson@creado.com> Message-ID: <677ec42a9ca539f8f76acad217eae1b1@wanadoo.es> El 10/06/2005, a las 10:44, Mikael Karlsson escribi?: > Is it possible to make use of Erlangs Corba support? > The ic (idl compiler) could maybe be patched for XPIDL > and orber used for resolving ObjectReference -> PiD ? I have no experience with ic and orber, just an overview. CORBA is really more complex than XPCOM and orber does a lot of things. I think that is better to write a smaill ORB. Patch ic for XPIDL is a good idea. Future versions should include it. -- Greets From chandrashekhar.mullaparthi@REDACTED Fri Jun 10 12:11:56 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 10 Jun 2005 11:11:56 +0100 Subject: URI escaping In-Reply-To: <200506092316.30424.will@misconception.org.uk> References: <200506092316.30424.will@misconception.org.uk> Message-ID: Look in ibrowse. ibrowse_lib:url_encode(Str) -> UrlEncodedStr Str = string() UrlEncodedStr = string() URL-encodes a string based on RFC 1738. Returns a flat list. cheers Chandru On 9 Jun 2005, at 23:16, Will Newton wrote: > > Is there any code in the OTP distribution for dealing with URIs, > specifically > escaping characters? > From casper2000a@REDACTED Fri Jun 10 13:08:49 2005 From: casper2000a@REDACTED (Casper) Date: Fri, 10 Jun 2005 17:08:49 +0600 Subject: String processing - regex Message-ID: Hi All, What's the best way to parse a string, such as "blahhh another word word2 test" As correctly extract, [mod, fun, arg1, arg2] Can I use io_lib:fread/2 or regex:split/2? Could anyone kindly give me the correct Format or RegExp string, since I am finding difficulty is getting the correct one? Also, io_lib:fread("~s:", "test:"). --> Error But io_lib:fread("~s :", "test :"). --> {ok,["test"],[]} Is it a must to have a space character to decode like above? Isn't there any better way to decode it in the original way ("test:")? Thanks in advance! - Eranga From csanto@REDACTED Fri Jun 10 14:22:46 2005 From: csanto@REDACTED (Corrado Santoro) Date: Fri, 10 Jun 2005 14:22:46 +0200 Subject: String processing - regex In-Reply-To: References: Message-ID: <42A98616.8030400@diit.unict.it> What about writing a grammar and use yecc? --Corrado Casper wrote: > Hi All, > > What's the best way to parse a string, such as > "blahhh another word word2 test" > > As correctly extract, > [mod, fun, arg1, arg2] > > Can I use io_lib:fread/2 or regex:split/2? Could anyone kindly give me the > correct Format or RegExp string, since I am finding difficulty is getting > the correct one? > > Also, > io_lib:fread("~s:", "test:"). --> Error > > But > io_lib:fread("~s :", "test :"). --> {ok,["test"],[]} > > Is it a must to have a space character to decode like above? Isn't there any > better way to decode it in the original way ("test:")? > > Thanks in advance! > - Eranga > > > > -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From casper2000a@REDACTED Fri Jun 10 14:24:38 2005 From: casper2000a@REDACTED (Casper) Date: Fri, 10 Jun 2005 18:24:38 +0600 Subject: String processing - regex In-Reply-To: Message-ID: Also I tried with Cellicium's gregexp module. "" I did it like, gregexp:groups("", "<\\(.+\\):\\(.+\\)[(]\\(.+\\)(,[\s*]\\(.+\\))*[)]>"). --> {match,["mod","fun","arg1","arg2","arg3","arg5,arg6"]} Only problem is last one doesn't get parse well.. Thanks in advance! - Eranga -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Casper Sent: Friday, June 10, 2005 5:09 PM To: erlang-questions@REDACTED Subject: String processing - regex Hi All, What's the best way to parse a string, such as "blahhh another word word2 test" As correctly extract, [mod, fun, arg1, arg2] Can I use io_lib:fread/2 or regex:split/2? Could anyone kindly give me the correct Format or RegExp string, since I am finding difficulty is getting the correct one? Also, io_lib:fread("~s:", "test:"). --> Error But io_lib:fread("~s :", "test :"). --> {ok,["test"],[]} Is it a must to have a space character to decode like above? Isn't there any better way to decode it in the original way ("test:")? Thanks in advance! - Eranga From casper2000a@REDACTED Fri Jun 10 14:28:34 2005 From: casper2000a@REDACTED (Casper) Date: Fri, 10 Jun 2005 18:28:34 +0600 Subject: String processing - regex In-Reply-To: <42A98616.8030400@diit.unict.it> Message-ID: Thanks for the advice, but I don't know yecc. If Erlang RegExp cannot do, I guess that'll be the next thing I will try to do. - Eranga -----Original Message----- From: Corrado Santoro [mailto:csanto@REDACTED] Sent: Friday, June 10, 2005 6:23 PM To: Casper Cc: erlang-questions@REDACTED Subject: Re: String processing - regex What about writing a grammar and use yecc? --Corrado Casper wrote: > Hi All, > > What's the best way to parse a string, such as > "blahhh another word word2 test" > > As correctly extract, > [mod, fun, arg1, arg2] > > Can I use io_lib:fread/2 or regex:split/2? Could anyone kindly give me the > correct Format or RegExp string, since I am finding difficulty is getting > the correct one? > > Also, > io_lib:fread("~s:", "test:"). --> Error > > But > io_lib:fread("~s :", "test :"). --> {ok,["test"],[]} > > Is it a must to have a space character to decode like above? Isn't there any > better way to decode it in the original way ("test:")? > > Thanks in advance! > - Eranga > > > > -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From vlad.xx.dumitrescu@REDACTED Fri Jun 10 14:35:14 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 10 Jun 2005 14:35:14 +0200 Subject: String processing - regex Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE57F@esealmw105.eemea.ericsson.se> Hi, -----Original Message----- From: Casper >Also I tried with Cellicium's gregexp module. Regexps wil only work if you can't have any of (),: in your args. Since I guess some of the args may be strings, it's not a realistic requirement. You have to use a parser, either as Corrado suggested, or if the content is Erlang code by using erl_scan and erl_parse. Since the code might also contain <> delimiters, you also have to extract it properly from the environment. This requires another parser :-) but a relatively simple one (just to recognize delimiters embedded in strings, character literals and escaped). regards, Vlad From klacke@REDACTED Fri Jun 10 15:38:56 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Fri, 10 Jun 2005 15:38:56 +0200 Subject: gen_tcp bug ? Message-ID: <42A997F0.7040807@hyber.org> Is This a bug ? I surely consider it weird and unexpected. Run a:srv() in one shell and then a:cli() in another? I'd expect the call to gen_tcp:recv(Fd, 100) to return {ok, Bin} where size(Bin) == 50 in the second call. That is how unix read() works. As it is now, it's not good and severely violates the "principle of least surprise" What do you think. I realize that the prefered mode of operation is to do gen_tcp:recv(Fd, 0) But ...... /klacke -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a.erl URL: From klacke@REDACTED Fri Jun 10 16:32:31 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Fri, 10 Jun 2005 16:32:31 +0200 Subject: yaws 1.55 Message-ID: <42A9A47F.5060703@hyber.org> New release of Yaws, Code and relnotes as usual at http://yaws.hyber.org Enjoy, /klacke From casper2000a@REDACTED Sat Jun 11 03:52:17 2005 From: casper2000a@REDACTED (casper2000a@REDACTED) Date: Sat, 11 Jun 2005 07:52:17 +0600 Subject: String processing - regex In-Reply-To: <1118415093.1452.9.camel@localhost.localdomain> References: <1118415093.1452.9.camel@localhost.localdomain> Message-ID: <1118454737.42aa43d146df3@www.omnibis.com> Hi Laurent, Thanks for the info. But I tried that too, gregexp:groups("", "<\\(.+\\):\\(.+\\)[(]\\(.+\\)(,[\s]*\\(.+\\))*[)]>"). --> {match,["mod","fun","arg1"," arg2"," arg3"," arg5","arg6"]} The result I get then have a space infront of arg2, arg3 and arg5. I want to get rid of any spaces in front. Ofcourse I can trim manually, but I'm sure there must be a way to get that done in one parse using regexp. Regards, - Eranga Quoting Laurent Picouleau : > Quoting Laurent Picouleau : > Hi Eranga, > > On Fri, 2005-06-10 at 13:24, Casper wrote: > > Also I tried with Cellicium\'s gregexp module. > > > > \"\" > > > > I did it like, > > gregexp:groups(\"\", > > \"<\\\\(.+\\\\):\\\\(.+\\\\)[(]\\\\(.+\\\\)(,[\\s*]\\\\(.+\\\\))*[)]>\"). > > --> {match,[\"mod\",\"fun\",\"arg1\",\"arg2\",\"arg3\",\"arg5,arg6\"]} > > > > Only problem is last one doesn\'t get parse well.. > > modify your regex to put [\\s]* instead of [\\s*] and you should have arg5 > and arg6. > > Br, > > -- > Laurent Picouleau > laurent.picouleau@REDACTED > > --------------This mail sent through OmniBIS.com-------------- From bcpierce@REDACTED Fri Jun 10 20:26:30 2005 From: bcpierce@REDACTED (Benjamin Pierce) Date: Fri, 10 Jun 2005 14:26:30 -0400 Subject: ICFP 2005 - Accepted papers Message-ID: The following papers will be presented at the 2005 International Conference on Functional Programming, in Tallinn, Estonia, September 26-28, 2005. For more information: http://www.brics.dk/~danvy/icfp05 Hope to see you there! - Benjamin Pierce ICFP '05 program chair ------------------------------------------------------------------------ ------------- Dynamic Optimization for Functional Reactive Programming using Generalized Algebraic Data Types by Henrik Nilsson Acute: high-level programming language design for distributed computation by Peter Sewell, James J. Leifer, Keith Wansbrough, Francesco Zappa Nardelli, Mair Allen-Williams, Pierre Habouzit, and Viktor Vafeiadis Fast Narrowing-Driven Partial Evaluation for Inductively Sequential Programs by J. Guadalupe Ramos, Josep Silva, German Vidal Monadic Augment and Generalised Short Cut Fusion by Neil Ghani, Patricia Johann, Tarmo Uustalu, Varmo Vene A Logical Analysis of Aliasing in Imperative Higher-Order Functions by Martin Berger, Kohei Honda and Nobuko Yoshida An Expressive Language of Signatures by Norman Ramsey, Kathleen Fisher, and Paul Govereau Aspectual Caml: an Aspect-Oriented Functional Language by Hideaki Tatsuzawa, Hidehiko Masuhara and Akinori Yonezawa Witnessing Side-effects by Tachio Terauchi and Alex Aiken Recursive Type Generativity by Derek Dreyer Backtracking, Interleving, and Terminating Monad Transformers (Functional Pearl) by Oleg Kiselyov, Chung-chieh Shan, Daniel P. Friedman, Amr Sabry Scrap your Nameplate (Functional Pearl) by James Cheney Qualified types for MLF by Daan Leijen and Andres Loeh PolyAML: A polymorphic aspect-oriented functional programmming language by Daniel S. Dantas, David Walker, Geoffrey Washburn and Stephanie Weirich A Principled Approach to Operating System Construction in Haskell by Thomas Hallgren, Mark P Jones, Rebekah Leslie, Andrew Tolmach Modular Verification of Concurrent Assembly Code with Dynamic Thread Creation and Termination by Xinyu Feng and Zhong Shao Associated Type Synonyms by Manuel M. T. Chakravarty, Gabriele Keller, and Simon Peyton Jones AtomCaml: First-Class Atomicity via Rollback by Michael F. Ringenburg and Dan Grossman Combining Programming with Theorem Proving by Chiyan Chen and Hongwei Xi A Language-based Approach to Functionally Correct Imperative Programming by Edwin Westbrook, Aaron Stump, Ian Wehrman Continuations from Lightweight Stack Inspection or, Passing on Continuation-Passing by Greg Pettyjohn, John Clements, Joe Marshall, Shriram Krishnamurthi, Matthias Felleisen The anatomy of a loop: A story of scope and control by Olin Shivers High-level Views on Low-level Representations by Iavor Diatchki Mark P. Jones Rebekah Leslie A Step-Indexed Model of Substructural State by Amal Ahmed, Matthew Fluet, Greg Morrisett Scrap your boilerplate with class: extensible generic functions by Ralf Laemmel, Simon Peyton Jones Exploring partial type inference for Predicative fragments of System-F by Didier Remy Type Inference, Principal Typings, and Let-Polymorphism for First-Class Mixin Modules by Henning Makholm and J. B. Wells From will@REDACTED Sat Jun 11 17:47:20 2005 From: will@REDACTED (Will Newton) Date: Sat, 11 Jun 2005 16:47:20 +0100 Subject: inets http client url escaping Message-ID: <200506111647.20669.will@misconception.org.uk> Is this expected behaviour? 9> http:request(get, {"http://localhost/index.cgi?foo=%9F", []}, [], []). {error,no_query} Is there a way to hex encode non 7-bit ASCII values in a path or query? I haven't found a canonical source on what the correct way to do this, RFC 2396 seems to leave it open, but I would expect to be able to do that. From erlang@REDACTED Sat Jun 11 18:41:13 2005 From: erlang@REDACTED (Bernardo Paroli) Date: Sat, 11 Jun 2005 13:41:13 -0300 Subject: Xmerl Message-ID: <003901c56ea4$621b5ee0$3400a8c0@BP> Hi, I'm using the xmerl module to parse XML files. Does it support xpath expressions like this: self::xml/child::param[@at=\"att\"]/@v ? I'm trying this but the xmerl_xpath:string function return the "unknown_expr" error. Regards, Bernardo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Mon Jun 13 10:25:16 2005 From: joelr1@REDACTED (joel reymont) Date: Mon, 13 Jun 2005 10:25:16 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: <42AB00FB.9010207@erlang-fr.org> References: <42AB00FB.9010207@erlang-fr.org> Message-ID: I took a quick look at the source code and there are quite a few places where FD_SETSIZE is hardcoded. So the number of open files fixed at 1024 on my Mac OSX 10.3.9. I could certainly edit the system header files and increase the limit to a more suitable number but... I cannot ask my customer to do this and rebuild Erlang. At least I can't always ask them to. Overall, 1024 file descriptors per Erlang node is WAY too low. Thanks, Joel On 6/11/05, Mickael Remond wrote: > joel reymont wrote: > > I will do this over the weekend. I compiled myself the R10B5 version > > just for the purpose. > > Maybe the environment variable ERL_MAX_PORT might also help in your > case. This use to be valid in the past but I do not know if this is > still the case: > > export ERL_MAX_PORTS=32000 -- http://wagerlabs.com/tech From sean.hinde@REDACTED Mon Jun 13 10:59:19 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 13 Jun 2005 09:59:19 +0100 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: <42AB00FB.9010207@erlang-fr.org> Message-ID: <3B85E2A6-9C81-498D-8350-A6763202F27C@mac.com> Hi, OS X should be able to support the BSD kqueue mechanism. I just had a quick go at compiling with --enable-kernel-poll, but somewhere in the process it loses track of the existence of kqueue - maybe a good place to start. Without at least one of the fancy poll mechanisms then you will be restricted to 1024 FDs - but that is why there is support for fancy poll mechanisms :) The only problem remaining is that there is no support for epoll in Linux 2.6, kqueue is broken for OS X at least, and sys.c is such a mess of ifdefs by now that it really should be re-written - it is a real pain to modify in its current state. Sean On 13 Jun 2005, at 09:25, joel reymont wrote: > I took a quick look at the source code and there are quite a few > places where FD_SETSIZE is hardcoded. So the number of open files > fixed at 1024 on my Mac OSX 10.3.9. I could certainly edit the system > header files and increase the limit to a more suitable number but... > I cannot ask my customer to do this and rebuild Erlang. At least I > can't always ask them to. > > Overall, 1024 file descriptors per Erlang node is WAY too low. > > Thanks, Joel > > On 6/11/05, Mickael Remond wrote: > >> joel reymont wrote: >> >>> I will do this over the weekend. I compiled myself the R10B5 version >>> just for the purpose. >>> >> >> Maybe the environment variable ERL_MAX_PORT might also help in your >> case. This use to be valid in the past but I do not know if this is >> still the case: >> >> export ERL_MAX_PORTS=32000 >> > > -- > http://wagerlabs.com/tech > From bengt.kleberg@REDACTED Mon Jun 13 11:07:33 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 13 Jun 2005 11:07:33 +0200 Subject: gen_tcp bug ? In-Reply-To: <42A997F0.7040807@hyber.org> References: <42A997F0.7040807@hyber.org> Message-ID: <42AD4CD5.4000503@ericsson.com> On 2005-06-10 15:38, Claes Wikstrom wrote: > > Is This a bug ? I surely consider it weird and unexpected. > > Run a:srv() in one shell and then a:cli() in another? > > I'd expect the call to gen_tcp:recv(Fd, 100) to return > {ok, Bin} where size(Bin) == 50 in the second call. That is > how unix read() works. As it is now, it's not good and severely > violates the "principle of least surprise" i think it depends upon how much c programming one has been subjected to. since there is no receive buffer that can be filled, the length is no longer a maximum limit. it is a ''this amount and no other'' request. if it returns successfully a non-c programmer would(should?) be very surprised if it has read less than length bytes. therefore {error, closed} is ok. i am happy with any one of both behaviours. ie, the current behaviour or the c like behaviour. perhaps {error, closed, Bin} would be a suitable compromise? bengt From klacke@REDACTED Mon Jun 13 11:24:10 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 13 Jun 2005 11:24:10 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: <42AB00FB.9010207@erlang-fr.org> Message-ID: <42AD50BA.2070406@hyber.org> joel reymont wrote: > I took a quick look at the source code and there are quite a few > places where FD_SETSIZE is hardcoded. So the number of open files > fixed at 1024 on my Mac OSX 10.3.9. I could certainly edit the system > header files and increase the limit to a more suitable number but... I seem to remember a couple of years ago when we had to support erlang on the BSDi OS, there was the same braindead FD_SETSIZE limitation. There was some trickery around it but I don't remember exactly, but I think it involved modified system headers. An alternative for your customers that require +1024 fds is to use OS X 10.4 which use poll() (I think) > > Overall, 1024 file descriptors per Erlang node is WAY too low. Absolutely, but remember, it's not Erlang that is restricted, it MacOsX. You'd have exactly the same problem if the app was written in C. >>Maybe the environment variable ERL_MAX_PORT might also help in your >>case. This use to be valid in the past but I do not know if this is >>still the case: >> >>export ERL_MAX_PORTS=32000 How could that help, when there is a buffer overflow in the fd_set /klacke From klacke@REDACTED Mon Jun 13 13:27:03 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Mon, 13 Jun 2005 13:27:03 +0200 Subject: gen_tcp bug ? In-Reply-To: <42AD4CD5.4000503@ericsson.com> References: <42A997F0.7040807@hyber.org> <42AD4CD5.4000503@ericsson.com> Message-ID: <42AD6D87.5090403@hyber.org> Bengt Kleberg wrote: > On 2005-06-10 15:38, Claes Wikstrom wrote: > > i think it depends upon how much c programming one has been subjected > to. I think it depends on wether one think it's best to either: a) drop the last read data, or b) deliver it The best choice should be obvious. > since there is no receive buffer that can be filled, the length is > no longer a maximum limit. it is a ''this amount and no other'' request. I disagree. > if it returns successfully a non-c programmer would(should?) be very > surprised if it has read less than length bytes. Very wrong, all reads from "slow devices" for example network sockets can always return less than requested. That's the way sockets work. > therefore {error, closed} is ok. > > i am happy with any one of both behaviours. ie, the current behaviour or > the c like behaviour. > > perhaps {error, closed, Bin} would be a suitable compromise? > > Well anything except silently dropping the data read in the last read() call is ok in my book. /klacke From serge@REDACTED Mon Jun 13 13:45:12 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 13 Jun 2005 07:45:12 -0400 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: References: <42AB00FB.9010207@erlang-fr.org> Message-ID: <42AD71C8.5070001@hq.idt.net> Joel, Since there seem to be a handful of obstacles in increasing the number of FDs on Mac OS, you could probably consider switching the transport from TCP to UDP. If you implement basic error correction in UDP (retransmission timers, dropping duplicate packets, transaction id awareness), it could be a quite scalable solution as long as open UDP sockets (except for the listener) are not retained on the server for a long time. I've been using this in one of the projects where I had exactly the same issue with TCP's TD limit, and tested the solution with over 50k concurrent processes handling client requests (though the size of the server's UDP receive buffer needs to be carefully selected). Though I have seen that the response time per client increases quite a bit when you go over 5000 requests per second. Yet on a good side - I haven't seen a degradation of server's speed measured in requests per second with increase of number of clients). Serge joel reymont wrote: > I took a quick look at the source code and there are quite a few > places where FD_SETSIZE is hardcoded. So the number of open files > fixed at 1024 on my Mac OSX 10.3.9. I could certainly edit the system > header files and increase the limit to a more suitable number but... > I cannot ask my customer to do this and rebuild Erlang. At least I > can't always ask them to. > > Overall, 1024 file descriptors per Erlang node is WAY too low. > > Thanks, Joel > > On 6/11/05, Mickael Remond wrote: > >>joel reymont wrote: >> >>>I will do this over the weekend. I compiled myself the R10B5 version >>>just for the purpose. >> >>Maybe the environment variable ERL_MAX_PORT might also help in your >>case. This use to be valid in the past but I do not know if this is >>still the case: >> >>export ERL_MAX_PORTS=32000 From micael.karlberg@REDACTED Mon Jun 13 13:54:06 2005 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Mon, 13 Jun 2005 13:54:06 +0200 Subject: Megaco text encoding problem with embedded Events In-Reply-To: <428BE4E2.2020303@nec.com.au> References: <428BE4E2.2020303@nec.com.au> Message-ID: <17069.29662.435473.642003@gargle.gargle.HOWL> Hi, Sorry for the long delay. You are correct. And it seems our decoder handles it "your" way (but not the encoder). Hopefully a fix will make into the next OTP release. Regards, /BMK Leigh Fiddes writes: > Hi, > > I am experimenting with the Erlang Megaco stack (3.0.1) and I am > having a problem encoding an embedded Events within an Event. > > The erlang code I am using is: > SRE1 = #'SecondRequestedEvent'{ pkgdName = "al/on", > evParList = [] }, > > SRA = #'SecondRequestedActions'{ eventDM = { digitMapName, "DialPlan0" }}, > > SRE2 = #'SecondRequestedEvent'{ pkgdName = "dd/ce", > eventAction = SRA, > evParList = [] }, > > SED = #'SecondEventsDescriptor'{ requestID = 2, > eventList = [ SRE1, SRE2 ] }, > > RA = #'RequestedActions'{ secondEvent = SED }, > > RE = #'RequestedEvent'{ pkgdName = "al/of", > eventAction = RA, > evParList = [] }, > > EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, > > TermID = {megaco_term_id, true, [[$*]] }, > > AMMR = #'AmmRequest'{ terminationID = [ TermID ], > descriptors = [{ eventsDescriptor, EV }]}, > > CR = #'CommandRequest'{command = {modReq, AMMR}}, > > AR = #'ActionRequest'{contextId = ?megaco_null_context_id, > commandRequests = [CR]}, > > > but the megaco message produced is: > Context = - { > Modify = * { > Events = 1 { > al/of { > Embed { > Events = 2 { > al/on > }, > Events = 2 { > dd/ce { > DigitMap = DialPlan0 > } > } > } > } > } > } > } > > whereas my reading of H.248.1 says that the correct syntax for this > should be: > > Context = - { > Modify = * { > Events = 1 { > al/of { > Embed { > Events = 2 { > al/on, > dd/ce { > DigitMap = DialPlan0 > } > } > } > } > } > } > } > > according to the standard: > > embedNoSig = EmbedToken LBRKT embedFirst RBRKT > ; at-most-once of each > embedFirst = EventsToken [ EQUAL RequestID LBRKT > secondRequestedEvent *(COMMA secondRequestedEvent) > RBRKT ] > secondRequestedEvent = pkgdName [ LBRKT secondEventParameter > *( COMMA secondEventParameter ) RBRKT ] > > Is my interpretation or method incorrect or is the pretty text > encoder incorrect? > > Regards, > Leigh > -- > ============================================================ > Leigh Fiddes email: Leigh.Fiddes@REDACTED > Software Development Manager Phone: +61 3 9264 3864 > Broadband Network Technology Division Fax: +61 3 9264 3892 > NEC Australia From raimo@REDACTED Mon Jun 13 13:55:35 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 13 Jun 2005 13:55:35 +0200 Subject: gen_tcp bug ? References: <42A997F0.7040807@hyber.org> Message-ID: I confirm this behaviour, and I regard it as a bug that I am about to fix. Not being a socket guru myself I wonder, what is the expected behaviour of gen_tcp:recv(Fd, N) when there are less than N bytes in the receive buffer but more than 0? a) To return with the available bytes. b) To wait until there are N bytes, but if the socket gets closed or some error occurs return with the available bytes and let subsequent calls indicate the error. My guess is b) but I would like a second opinion. klacke@REDACTED (Claes Wikstrom) writes: > Is This a bug ? I surely consider it weird and unexpected. > > Run a:srv() in one shell and then a:cli() in another? > > I'd expect the call to gen_tcp:recv(Fd, 100) to return > {ok, Bin} where size(Bin) == 50 in the second call. That is > how unix read() works. As it is now, it's not good and severely > violates the "principle of least surprise" > > What do you think. > > I realize that the prefered mode of operation is to do > > gen_tcp:recv(Fd, 0) > > > But ...... > > > > /klacke > > -module(a). > -compile(export_all). > > > > srv() -> > {ok, LS} = gen_tcp:listen(5678,[{active, false}, binary]), > {ok, A} = gen_tcp:accept(LS), > srv(A, gen_tcp:recv(A, 100)). > > srv(Fd, {ok, Bin}) -> > io:format("Got ~p bytes\n", [size(Bin)]), > srv(Fd, gen_tcp:recv(Fd, 100)); > srv(Fd, Err) -> > io:format("ERR: ~p~n", [Err]). > > > > > > cli() -> > {ok, Fd} = gen_tcp:connect(localhost, 5678, [{active, false}]), > gen_tcp:send(Fd, lists:duplicate(150, $A)), > gen_tcp:close(Fd). > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bjorn@REDACTED Mon Jun 13 13:59:01 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Jun 2005 13:59:01 +0200 Subject: R10B3 crashes after >1014 tcp connections + Yaws In-Reply-To: <42AD50BA.2070406@hyber.org> References: <42AB00FB.9010207@erlang-fr.org> <42AD50BA.2070406@hyber.org> Message-ID: Claes Wikstrom writes: > joel reymont wrote: > > I took a quick look at the source code and there are quite a few > > places where FD_SETSIZE is hardcoded. So the number of open files > > fixed at 1024 on my Mac OSX 10.3.9. I could certainly edit the system > > header files and increase the limit to a more suitable number but... > > I seem to remember a couple of years ago when we had to > support erlang on the BSDi OS, there was the same braindead > FD_SETSIZE limitation. > > There was some trickery around it but I don't remember > exactly, but I think it involved modified system headers. > FD_SETSIZE can be defined before including . That will change the size of struct fd_set. It is mentioned in the man page for select() on Mac OS X. We still have code in OTP to raise the value of FD_SETSIZE from 256 to 1024 on a platform called BSDi. (See erts/configure.in.) Using that mechanism, it should be possibly to further raise the limit by three easy changes to config.h (AFTER running configure): 1) Define REDEFINE_FD_SETSIZE. 2) #define USE_SELECT (Will not be necessary in R10B-6, because it is already done. 3) Change the define for FD_SETSIZE to an appropriate value. I don't know how many file descriptors the Mac OS X kernel actually supports, but the man page suggests that it is more than 1024. > An alternative for your customers that require +1024 fds > is to use OS X 10.4 which use poll() (I think) > No, poll() in Mac OS X 10.4 doesn't support devices. configure in R10B-6 will detect that and force the use of select(). /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Mon Jun 13 14:55:18 2005 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 13 Jun 2005 14:55:18 +0200 Subject: gen_tcp bug ? In-Reply-To: <42AD6D87.5090403@hyber.org> References: <42A997F0.7040807@hyber.org> <42AD4CD5.4000503@ericsson.com> <42AD6D87.5090403@hyber.org> Message-ID: <42AD8236.8000709@ericsson.com> On 2005-06-13 13:27, Claes Wikstrom wrote: ...deleted > > Very wrong, all reads from "slow devices" for example > network sockets can always return less than requested. > That's the way sockets work. you are correct. i can live with a c like behaviour for recv/2. but i still think it is ok to have a recv/1 that gives me all available bytes and a recv/2 that gives me the right amount or an error. the latter to be used when only the right amount is of interest (ie, too few bytes will not be of any use, so i do not need to see them). imho. bengt From laurent.picouleau@REDACTED Mon Jun 13 15:22:13 2005 From: laurent.picouleau@REDACTED (Laurent Picouleau) Date: Mon, 13 Jun 2005 14:22:13 +0100 Subject: String processing - regex In-Reply-To: <1118454737.42aa43d146df3@www.omnibis.com> References: <1118415093.1452.9.camel@localhost.localdomain> <1118454737.42aa43d146df3@www.omnibis.com> Message-ID: <1118668932.22394.6.camel@localhost.localdomain> Hi Eranga, On Sat, 2005-06-11 at 02:52, casper2000a@REDACTED wrote: > Hi Laurent, > > Thanks for the info. But I tried that too, > gregexp:groups("", "<\\(.+\\):\\(.+\\)[(]\\(.+\\)(,[\s]*\\(.+\\))*[)]>"). > --> {match,["mod","fun","arg1"," arg2"," arg3"," arg5","arg6"]} > > The result I get then have a space infront of arg2, arg3 and arg5. I want to get rid of any spaces in > front. Ofcourse I can trim manually, but I'm sure there must be a way to get that done in one parse > using regexp. This is more a regex problem than an erlang problem IMHO. You could do it like with this regex: "<\\(.+\\):\\(.+\\)[(]\\(.+\\)(,[\s]*\\([^ ]+\\))*[)]>" ==== Here I've used anything but space ( [^ ] ) but ideally you would like to have anything but \s. See the documentation of this particular regex language to have the expected behaviour. Br, -- Laurent Picouleau laurent.picouleau@REDACTED From hedeland@REDACTED Mon Jun 13 15:23:48 2005 From: hedeland@REDACTED (Per Hedeland) Date: Mon, 13 Jun 2005 15:23:48 +0200 (CEST) Subject: gen_tcp bug ? In-Reply-To: Message-ID: <200506131323.j5DDNmjQ081168@tordmule.bluetail.com> Raimo Niskanen wrote: > >I confirm this behaviour, and I regard it as a bug that I am about to >fix. Not being a socket guru myself I wonder, what is the expected >behaviour of gen_tcp:recv(Fd, N) when there are less than N >bytes in the receive buffer but more than 0? > >a) To return with the available bytes. >b) To wait until there are N bytes, but if the socket gets closed > or some error occurs return with the available bytes and let > subsequent calls indicate the error. > >My guess is b) but I would like a second opinion. Well, my opinion is that it's obvious that the semantics of gen_tcp:recv() are *intended* to be different from Unix read() (as bengt explained), since you can get read()-like semantics with Length = 0. I.e. it *is* an error condition if you request 100 bytes and this request can't be fulfilled - just returning {ok, Packet} in that case would be wrong. I would imagine that people use gen_tcp:recv() with Length /= 0 to implement their own "packet" schemes - i.e. recv() the header (with fixed length), extract the length of the data from that, and recv() exactly the data. If you make the change Klacke wants, you'll break such code - it becomes necessary to check the amount of data returned by each recv(). I'm not sure it's a good idea to return an error *and* the remaining bytes though - so my vote (FWIW) would probably be that the current behaviour is correct. --Per From erlang@REDACTED Mon Jun 13 22:12:18 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Mon, 13 Jun 2005 17:12:18 -0300 Subject: Yaws + SSL + POST HTTP Message-ID: <008a01c57054$37136970$4a00a8c0@Inswitch251> Hi, I'm having problems with Yaws+SSL and the following HTML :
The POST HTTP request over and SSL connection is not correctly been handled by the Yaws web server. Any ideas? Do I have to use another enc MIME-type? thanks, Eduardo Figoli Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Ing. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: From sean.hinde@REDACTED Mon Jun 13 22:42:53 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 13 Jun 2005 21:42:53 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <008a01c57054$37136970$4a00a8c0@Inswitch251> References: <008a01c57054$37136970$4a00a8c0@Inswitch251> Message-ID: <2CEED98F-589A-4247-9A27-EF6C26F7F2DE@mac.com> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > Hi, > > I'm having problems with Yaws+SSL and the following HTML : > enctype="multipart/form-data"> > > The POST HTTP request over and SSL connection is not correctly been > handled by the Yaws web server. > Any ideas? Do I have to use another enc MIME-type? This looks fine. Does it work without SSL? See the file upload example for an example of usage of this enctype: http://yaws.hyber.org/upload0.yaws Sean From erlang@REDACTED Mon Jun 13 22:45:53 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Mon, 13 Jun 2005 17:45:53 -0300 Subject: Yaws + SSL + POST HTTP References: <008a01c57054$37136970$4a00a8c0@Inswitch251> <2CEED98F-589A-4247-9A27-EF6C26F7F2DE@mac.com> Message-ID: <00b401c57058$e82c56a0$4a00a8c0@Inswitch251> Hi Sean, Yes it works perfectly. Eduardo ----- Original Message ----- From: "Sean Hinde" To: "Inswitch Solutions" Cc: Sent: Monday, June 13, 2005 5:42 PM Subject: Re: Yaws + SSL + POST HTTP > > On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > > > Hi, > > > > I'm having problems with Yaws+SSL and the following HTML : > > > enctype="multipart/form-data"> > > > > The POST HTTP request over and SSL connection is not correctly been > > handled by the Yaws web server. > > Any ideas? Do I have to use another enc MIME-type? > > This looks fine. Does it work without SSL? > > See the file upload example for an example of usage of this enctype: > > http://yaws.hyber.org/upload0.yaws > > Sean > From sean.hinde@REDACTED Mon Jun 13 22:50:06 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 13 Jun 2005 21:50:06 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <00b401c57058$e82c56a0$4a00a8c0@Inswitch251> References: <008a01c57054$37136970$4a00a8c0@Inswitch251> <2CEED98F-589A-4247-9A27-EF6C26F7F2DE@mac.com> <00b401c57058$e82c56a0$4a00a8c0@Inswitch251> Message-ID: Have you tried applying the patch to the SSL driver recently described on the mailing list? Sean On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > Hi Sean, > > Yes it works perfectly. > > Eduardo > > > ----- Original Message ----- > From: "Sean Hinde" > To: "Inswitch Solutions" > Cc: > Sent: Monday, June 13, 2005 5:42 PM > Subject: Re: Yaws + SSL + POST HTTP > > > >> >> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: >> >> >>> Hi, >>> >>> I'm having problems with Yaws+SSL and the following HTML : >>> >> enctype="multipart/form-data"> >>> >>> The POST HTTP request over and SSL connection is not correctly been >>> handled by the Yaws web server. >>> Any ideas? Do I have to use another enc MIME-type? >>> >> >> This looks fine. Does it work without SSL? >> >> See the file upload example for an example of usage of this enctype: >> >> http://yaws.hyber.org/upload0.yaws >> >> Sean >> >> > > From erlang@REDACTED Mon Jun 13 22:53:23 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Mon, 13 Jun 2005 17:53:23 -0300 Subject: Yaws + SSL + POST HTTP References: <008a01c57054$37136970$4a00a8c0@Inswitch251> <2CEED98F-589A-4247-9A27-EF6C26F7F2DE@mac.com> <00b401c57058$e82c56a0$4a00a8c0@Inswitch251> Message-ID: <00ba01c57059$f36cef10$4a00a8c0@Inswitch251> No, will do. Thanks. Eduardo ----- Original Message ----- From: "Sean Hinde" To: "Inswitch Solutions" Cc: Sent: Monday, June 13, 2005 5:50 PM Subject: Re: Yaws + SSL + POST HTTP > Have you tried applying the patch to the SSL driver recently > described on the mailing list? > > Sean > > > On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > > > Hi Sean, > > > > Yes it works perfectly. > > > > Eduardo > > > > > > ----- Original Message ----- > > From: "Sean Hinde" > > To: "Inswitch Solutions" > > Cc: > > Sent: Monday, June 13, 2005 5:42 PM > > Subject: Re: Yaws + SSL + POST HTTP > > > > > > > >> > >> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > >> > >> > >>> Hi, > >>> > >>> I'm having problems with Yaws+SSL and the following HTML : > >>> >>> enctype="multipart/form-data"> > >>> > >>> The POST HTTP request over and SSL connection is not correctly been > >>> handled by the Yaws web server. > >>> Any ideas? Do I have to use another enc MIME-type? > >>> > >> > >> This looks fine. Does it work without SSL? > >> > >> See the file upload example for an example of usage of this enctype: > >> > >> http://yaws.hyber.org/upload0.yaws > >> > >> Sean > >> > >> > > > > > > From mickael.remond@REDACTED Mon Jun 13 23:46:55 2005 From: mickael.remond@REDACTED (=?ISO-8859-1?Q?Micka=EBl_R=E9mond?=) Date: Mon, 13 Jun 2005 23:46:55 +0200 Subject: Erlang REPOS 1.2 rc1 Message-ID: Hello, We have release a version of Erlang REPOS CDROM 1.2 rc1. This version is intended for testing purpose. As we support several architecture this testing phase is important, because it helps catching problems. This version is a major improvement over the 1.1 release: - Repos 1.2 is based on Erlang/OTP R10B-3. - ejabberd has been upgraded to version 0.9 - Dialyzer has been upgraded to version 1.2 - Yaws is now included in version 1.54 - Tsunami benchmark tool has been upgraded to version 1.0.2 - MacOSX Tiger support - Bluetail Ticket Tracker has been added More details on the following URL: http://www.erlang-projects.org/Public/projects/workgroups/repos/ erlang_repos_1.2-rc1/view The download area for Erlang REPOS is located on: http://downloads.erlang-projects.org/repos/ The compressed ISO can be downloaded from: http://downloads.erlang-projects.org/repos/repos-1.2_rc1.iso.tar.gz (Around 100 Mo). Have fun ! -- The Erlang REPOS team From chandrashekhar.mullaparthi@REDACTED Tue Jun 14 00:56:46 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Mon, 13 Jun 2005 23:56:46 +0100 Subject: gen_tcp bug ? In-Reply-To: References: <42A997F0.7040807@hyber.org> Message-ID: <4a940337594c92138fbb7647800baa05@t-mobile.co.uk> On 13 Jun 2005, at 12:55, Raimo Niskanen wrote: > I confirm this behaviour, and I regard it as a bug that I am about to > fix. Not being a socket guru myself I wonder, what is the expected > behaviour of gen_tcp:recv(Fd, N) when there are less than N > bytes in the receive buffer but more than 0? > > a) To return with the available bytes. > b) To wait until there are N bytes, but if the socket gets closed > or some error occurs return with the available bytes and let > subsequent calls indicate the error. > > My guess is b) but I would like a second opinion. > The best compromise is to probably introduce a new return value as Bengt suggested - {error, closed, Data}. This also avoids the problem which Per raised. Or in the case of 'active' sockets, a {tcp_closed, Socket, Data} message. The same problem exists when the option {active, once} or {active, true} is set and the {packet, PacketType} mode is used? -module(a). -compile(export_all). srv1() -> {ok, LS} = gen_tcp:listen(5678,[{active, true}, binary, {packet, line}]), {ok, A} = gen_tcp:accept(LS), srv1_loop(A). srv1_loop(A) -> receive {tcp, A, Bin} -> io:format("Got ~p bytes\n", [size(Bin)]), srv1_loop(A); {tcp_closed, A} -> io:format("Socket closed...~n", []); Err -> io:format("Recvd ~p~n", [Err]) end. cli() -> {ok, Fd} = gen_tcp:connect(localhost, 5678, [{active, false}]), gen_tcp:send(Fd, lists:duplicate(150, $A)), gen_tcp:close(Fd). cheers Chandru From Jouni.Ryno@REDACTED Tue Jun 14 09:10:59 2005 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-15?Q?Ryn=F6?=) Date: Tue, 14 Jun 2005 10:10:59 +0300 Subject: Erlang got a small mention in the story, which is mentioned in the slashdot Message-ID: The slashdot has a link to the story http://www.tbray.org/ongoing/When/200x/2005/06/12/Threads Would be interested to know, if www.erlang.org gets more hits today? Jouni From casper2000a@REDACTED Tue Jun 14 10:21:49 2005 From: casper2000a@REDACTED (casper2000a@REDACTED) Date: Tue, 14 Jun 2005 14:21:49 +0600 Subject: String processing - regex In-Reply-To: <1118668932.22394.6.camel@localhost.localdomain> References: <1118415093.1452.9.camel@localhost.localdomain> <1118454737.42aa43d146df3@www.omnibis.com> <1118668932.22394.6.camel@localhost.localdomain> Message-ID: <1118737309.42ae939d3eb96@www.omnibis.com> Hi Laurent, Thanks a lot for your help/advice. It's working perfectly. Cheers, - Eranga Quoting Laurent Picouleau : > Quoting Laurent Picouleau : > Hi Eranga, > > On Sat, 2005-06-11 at 02:52, casper2000a@REDACTED wrote: > > Hi Laurent, > > > > Thanks for the info. But I tried that too, > > gregexp:groups(\"\", > \"<\\\\(.+\\\\):\\\\(.+\\\\)[(]\\\\(.+\\\\)(,[\\s]*\\\\(.+\\\\))*[)]>\"). > > --> {match,[\"mod\",\"fun\",\"arg1\",\" arg2\",\" arg3\",\" arg5\",\"arg6\"]} > > > > The result I get then have a space infront of arg2, arg3 and arg5. I want > to get rid of any spaces in > > front. Ofcourse I can trim manually, but I\'m sure there must be a way to > get that done in one parse > > using regexp. > > This is more a regex problem than an erlang problem IMHO. You could do > it like with this regex: > \"<\\\\(.+\\\\):\\\\(.+\\\\)[(]\\\\(.+\\\\)(,[\\s]*\\\\([^ ]+\\\\))*[)]>\" > ==== > > Here I\'ve used anything but space ( [^ ] ) but ideally you would like to > have anything but \\s. See the documentation of this particular regex > language to have the expected behaviour. > > Br, > > -- > Laurent Picouleau > laurent.picouleau@REDACTED > > --------------This mail sent through OmniBIS.com-------------- From thomasl_erlang@REDACTED Tue Jun 14 12:48:30 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 14 Jun 2005 03:48:30 -0700 (PDT) Subject: Getting concurrency Message-ID: <20050614104830.48713.qmail@web41902.mail.yahoo.com> Someone just mentioned the following article (and I managed to delete the original mail): http://www.tbray.org/ongoing/When/200x/2005/06/12/Threads Regarding Erlang, I think Bray is posing one question and rebutting another. The question is, in essence, will the mainstream ever "get" concurrency? In particular, does Erlang hold the answer to how to get it? His answer is, his "biggest programming wins have been all about a bunch of threads running around a big shared data structure", which Erlang avoids. Thus, Erlang is not quite what's needed. But that objection seems to be about performance first of all, not about quality. Nontrivial use of shared datastructures _is_ quite difficult to work with, regarding correctness, resilience, scalability, and performance. If you want the foot soldiers to get it right on a regular basis, going at it on the level of threads and locks is thus probably the wrong approach. (A more promising approach in the "shared data for the masses paradigm", IMO, is to use transactions pervasively. And yes, I'll admit it: that approach is not ready to deploy tomorrow :-) On the other hand, can we then claim that message passing without shared state is The Answer? As most experienced Erlang programmers know, ets and mnesia tend to show up after a while, so at the logical level shared state is still with us. The real answer (if there indeed is any "the" answer to be found) is somewhere in between (and Erlang/OTP is not necessarily the ideal trade-off). However, even with this caveat, I would still claim that message passing, when applicable, is easier to work with, safer to use, and transfers to a distributed setting more easily, when compared to threads and shared state -- so, as a starting point, it makes good sense. Best, Thomas __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From Jouni.Ryno@REDACTED Tue Jun 14 13:10:12 2005 From: Jouni.Ryno@REDACTED (Jouni =?ISO-8859-15?Q?Ryn=F6?=) Date: Tue, 14 Jun 2005 14:10:12 +0300 Subject: Getting concurrency In-Reply-To: <20050614104830.48713.qmail@web41902.mail.yahoo.com> References: <20050614104830.48713.qmail@web41902.mail.yahoo.com> Message-ID: One should note, that author also writes: Problem: Testing and Debugging I am right now, in the Zeppelin context, grinding away on a highly concurrent multi-threaded application. Debugging it is a complete mindfuck, and I’m spending too much time debugging it because I have no idea how to write the unit tests. Consider a method that gets a network request for more resources, discovers which other computers in the cluster are advertising cycles to spare, pings them to see if they’re really there, asks them to handle the request, and reports back to the requester; how do you unit-test that? I have no idea. ? This is hard low-level Computer Science and we in the industry trenches could sure use some help from the researchers; are the researchers looking in this direction? So even if one could easily write multi-threaded applications, do they work and how do prove it :) Jouni On Tue, 14 Jun 2005 03:48:30 -0700 (PDT) Thomas Lindgren wrote: > > Someone just mentioned the following article (and I > managed to delete the original mail): > > http://www.tbray.org/ongoing/When/200x/2005/06/12/Threads > > Regarding Erlang, I think Bray is posing one question > and rebutting another. The question is, in essence, > will the mainstream ever "get" concurrency? In > particular, does Erlang hold the answer to how to get > it? His answer is, his "biggest programming wins have > been all about a bunch of threads running around a big > shared data structure", which Erlang avoids. Thus, > Erlang is not quite what's needed. > > But that objection seems to be about performance first > of all, not about quality. Nontrivial use of shared > datastructures _is_ quite difficult to work with, > regarding correctness, resilience, scalability, and > performance. If you want the foot soldiers to get it > right on a regular basis, going at it on the level of > threads and locks is thus probably the wrong approach. > > (A more promising approach in the "shared data for the > masses paradigm", IMO, is to use transactions > pervasively. And yes, I'll admit it: that approach is > not ready to deploy tomorrow :-) > > On the other hand, can we then claim that message > passing without shared state is The Answer? As most > experienced Erlang programmers know, ets and mnesia > tend to show up after a while, so at the logical level > shared state is still with us. The real answer (if > there indeed is any "the" answer to be found) is > somewhere in between (and Erlang/OTP is not > necessarily the ideal trade-off). > > However, even with this caveat, I would still claim > that message passing, when applicable, is easier to > work with, safer to use, and transfers to a > distributed setting more easily, when compared to > threads and shared state -- so, as a starting point, > it makes good sense. > > Best, > Thomas > > > > > __________________________________ > Yahoo! Mail > Stay connected, organized, and protected. Take the tour: > http://tour.mail.yahoo.com/mailtour.html > From vlad.xx.dumitrescu@REDACTED Tue Jun 14 13:24:00 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 14 Jun 2005 13:24:00 +0200 Subject: Getting concurrency Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE580@esealmw105.eemea.ericsson.se> Hi, > From: Thomas Lindgren > On the other hand, can we then claim that message > passing without shared state is The Answer? As most > experienced Erlang programmers know, ets and mnesia > tend to show up after a while, so at the logical level > shared state is still with us. I apologize if it will show up that I was misunderstanding, but I feel a little confused by the above. I don't think there is any non-trivial concurrent setting where data won't be shared at the 'logical level' you mention (if I understood correctly what you mean by that). Either the data is completely intenal to a process, or it is accessible from other processes. In the first case there's no concurrency, in the other it becomes shared at the logical level. [ In my experience, ets and mnesia tend to appear because there are no other mutable data structures in Erlang, which is an artifact of the language design, not of the concurrency model. ] So shared data is unavoidable at the logical level, because if nobody else needs it, we could just as well not compute anything :-) The issue is how to manage access to that data: should the clients bear the burden of ensuring that the result will be correct, or should there be a central manager for that data, independent of the clients? The former can be very efficient, but above a certain level of complexity it is very difficult to admninstrate. The latter is much easier to get right, at the price of extra overhead. An interesting analogy I just came to think of is that isolated processes with copy-semantics message passing is to "regular" multithreading what object-orientation is to spaghetti code. Just my 2 cents worth. best regards, Vlad From thomasl_erlang@REDACTED Tue Jun 14 14:35:36 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 14 Jun 2005 05:35:36 -0700 (PDT) Subject: Getting concurrency In-Reply-To: <11498CB7D3FCB54897058DE63BE3897C4BE580@esealmw105.eemea.ericsson.se> Message-ID: <20050614123536.80817.qmail@web41907.mail.yahoo.com> --- "Vlad Dumitrescu XX (LN/EAB)" wrote: > Hi, > > > From: Thomas Lindgren > > On the other hand, can we then claim that message > > passing without shared state is The Answer? As > most > > experienced Erlang programmers know, ets and > mnesia > > tend to show up after a while, so at the logical > level > > shared state is still with us. > > I apologize if it will show up that I was > misunderstanding, but I feel a little confused by > the above. > > I don't think there is any non-trivial concurrent > setting where data won't be shared at the 'logical > level' you mention (if I understood correctly what > you mean by that). Either the data is completely > intenal to a process, or it is accessible from other > processes. In the first case there's no concurrency, > in the other it becomes shared at the logical level. Yeah, I'm not completely happy with how I expressed that. But basically I'm thinking of the data _not_ communicated via regular message passing :-) I.e., where you start sliding into the difficult threads-and-locks issues again. Well, that part was kind of half-baked, take it for what it's worth. > The issue is how to manage access to that data: > should the clients bear the burden of ensuring that > the result will be correct, or should there be a > central manager for that data, independent of the > clients? > The former can be very efficient, but above a > certain level of complexity it is very difficult to > admninstrate. > The latter is much easier to get right, at the > price of extra overhead. Yes, good point. Mnesia on one node could conceivably be just a single gen_server; much simpler to write, but likely a bottleneck. I'm not sure there is a good, systematic way to get from "the simple case" to "the efficient case", though. For threads-and-locks, one could start with a big lock and successively refine it, e.g., split the critical region into smaller ones and try to shrink them, etc. Doing this might not yield an optimal solution, but it would at least optimize execution a bit. Is there a useful equivalent to this for message passing? OK, back to work ... :-) Best, Thomas __________________________________ Discover Yahoo! Get on-the-go sports scores, stock quotes, news and more. Check it out! http://discover.yahoo.com/mobile.html From sean.hinde@REDACTED Tue Jun 14 14:54:18 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 14 Jun 2005 13:54:18 +0100 Subject: Getting concurrency In-Reply-To: <20050614123536.80817.qmail@web41907.mail.yahoo.com> References: <20050614123536.80817.qmail@web41907.mail.yahoo.com> Message-ID: > > For threads-and-locks, one could start with a big lock > and successively refine it, e.g., split the critical > region into smaller ones and try to shrink them, etc. > Doing this might not yield an optimal solution, but it > would at least optimize execution a bit. > > Is there a useful equivalent to this for message > passing? One process for each real world concurrent activity? > > OK, back to work ... :-) Good to hear it ;-) Sean From ulf.wiger@REDACTED Tue Jun 14 15:25:07 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 14 Jun 2005 15:25:07 +0200 Subject: Getting concurrency Message-ID: Vlad wrote: > [ In my experience, ets and mnesia tend to appear because > there are no other mutable data structures in Erlang, which > is an artifact of the language design, not of the > concurrency model. ] Actually, the ets API can be fully emulated with an Erlang implementation -- essentially spawning a process for each ets table. I did it once for the ECOMP (Erlang Processor), and on a regular workstation, it was about 30x slower than built-in ETS. Robert Virding wrote his own erlang-based ETS at the same time. We compared notes for a while. My implementation was more beautiful than his, but his was slightly faster. ;-) There were some unfortunate API decisions in ETS that caused most of the performance penalty... or mainly only one: ets tables can be "registered", but they don't share namespaces with processes (i.e. you can have a process and an ets table "registered" under the same name.) Furthermore, you can have private named tables. This makes it pretty much impossible to fully emulate an ets table with a process -- you have to put a name server process in there in order to find the process holding the table. Ignoring named tables, the performance difference between built-in ets and erlang-based ets is quite small. Semantically, there are no show stoppers. /Uffe From joe.armstrong@REDACTED Tue Jun 14 15:34:24 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 14 Jun 2005 15:34:24 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: This thread has a crazy title "Getting concurrency" - this implies people just don't get it The title should be "Getting locks and sharing" - now that's the stuff I just don't get try and make locks and shared data work in the presence of failure - now that *is* a nightmare. Let's imagine the *simplest possible* fault tolerant system - it has TWO physically separated processors on two physically separated machines (etc etc etc) (call these A and B) - to make things fault tolerant you must make sure that A can take over if B fails, and B can take over if A fails. Now if A and B share data what happens after A (or B) has failed? - answer "Dunno Guv - Ask me another one..." No locks and sharing are the difficult to understand NOT concurrency. The real world IS concurrent - objects in the real world do not share data. If I make a statement "2 = 1 + 1" then each person who reads this forms their own mental image of the statement in their brain. If 500 people read this post, then there will be 500 copies of "2 = 1+1" stored somehow in 500 brains. We have a private data store (brain) and communicate by message passing (sound and light waves) we don't share data - we all have our own private copies - if we did share data all our heads would be glued together like some form of grotesque Siamese twin. Concurrency IS - that's how the world is - things happen in parallel. Modelling this with sequential processes and locks and sharing is totally artificial it is counter intuitive and monstrously difficult. Locks and sharing etc are understandable when there are no errors, but when errors occur become horrendously difficult. The programmer thought: Lock the resource Do the operation Unlock the resource What happened was Lock the resource Program doing the operation crashes And the unlock never occurs Have you ever waited a day for a NFS lock to time out. Have you every tried to start a system daemon that was not running only to be told that it was running - because of some lock file that you never knew existed should have been deleted but wasn't? ---- You can program perfectly well without locks and sharing just by using message passing to both communicate and synchronise - the code is simple and easy to understand. Currency isn't difficult to "get" - but locks and sharing are /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Sean Hinde > Sent: den 14 juni 2005 14:54 > To: Thomas Lindgren > Cc: erlang-questions > Subject: Re: Getting concurrency > > > > > > For threads-and-locks, one could start with a big lock > > and successively refine it, e.g., split the critical > > region into smaller ones and try to shrink them, etc. > > Doing this might not yield an optimal solution, but it > > would at least optimize execution a bit. > > > > Is there a useful equivalent to this for message > > passing? > > One process for each real world concurrent activity? > > > > > OK, back to work ... :-) > > Good to hear it ;-) > > Sean > > From vlad.xx.dumitrescu@REDACTED Tue Jun 14 15:30:08 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Tue, 14 Jun 2005 15:30:08 +0200 Subject: Getting concurrency Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE581@esealmw105.eemea.ericsson.se> From: Ulf Wiger(AL/EAB) >Vlad wrote: >> [ In my experience, ets and mnesia tend to appear because >> there are no other mutable data structures in Erlang, which >> is an artifact of the language design, not of the >> concurrency model. ] >Actually, the ets API can be fully emulated with an Erlang >implementation That's what I meant too. I said "only" because usually there's no need to implement a dedicated server, when ets works so nicely. regards, Vlad From mike@REDACTED Tue Jun 14 19:02:36 2005 From: mike@REDACTED (Michael Williams) Date: 14 Jun 2005 17:02:36 GMT Subject: Getting locks and sharing: was RE: Getting concurrency References: Message-ID: In article , joe.armstrong@REDACTED (Joe Armstrong AL/EAB) writes: |> The title should be "Getting locks and sharing" - now that's the stuff I just don't get |> try and make locks and shared data work in the presence of failure - now that *is* |> a nightmare. Erlang programmers use concurrency (processes) to program things which happen independently at the same time. Other people use concurrency to let several CPU to process a chunk of data ("a bunch of threads running arround a big shared data structure"). These two ways to "use" concurrency are fundamentally different. Bray is writing about the second way to "use" concurrency" and possibly has never done any programming which requires the "Erlang" way. My guess is that the multi-core multi-threaded chip manuafacturers have probably yet to realise that there is a market in Erlang type applications. SUN will shut up about this until they have found some way to squeeze Java into Erlang type applications. /mike From erlang@REDACTED Tue Jun 14 19:02:22 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 14 Jun 2005 14:02:22 -0300 Subject: Yaws + SSL + POST HTTP Message-ID: <012301c57102$dc33e930$4a00a8c0@Inswitch251> Hi Sean, I have installed the latest Yaws 1.55 but it doesn't work neither. Using upload.yaws I've seen that with small files (4kb) the upload works but with larger ones no (120kb). Any ideas? thanks, Eduardo Figoli ----- Original Message ----- From: "Inswitch Solutions" To: "Sean Hinde" Cc: Sent: Monday, June 13, 2005 5:53 PM Subject: Re: Yaws + SSL + POST HTTP > No, will do. > > Thanks. > Eduardo > ----- Original Message ----- > From: "Sean Hinde" > To: "Inswitch Solutions" > Cc: > Sent: Monday, June 13, 2005 5:50 PM > Subject: Re: Yaws + SSL + POST HTTP > > > > Have you tried applying the patch to the SSL driver recently > > described on the mailing list? > > > > Sean > > > > > > On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > > > > > Hi Sean, > > > > > > Yes it works perfectly. > > > > > > Eduardo > > > > > > > > > ----- Original Message ----- > > > From: "Sean Hinde" > > > To: "Inswitch Solutions" > > > Cc: > > > Sent: Monday, June 13, 2005 5:42 PM > > > Subject: Re: Yaws + SSL + POST HTTP > > > > > > > > > > > >> > > >> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > > >> > > >> > > >>> Hi, > > >>> > > >>> I'm having problems with Yaws+SSL and the following HTML : > > >>> > >>> enctype="multipart/form-data"> > > >>> > > >>> The POST HTTP request over and SSL connection is not correctly been > > >>> handled by the Yaws web server. > > >>> Any ideas? Do I have to use another enc MIME-type? > > >>> > > >> > > >> This looks fine. Does it work without SSL? > > >> > > >> See the file upload example for an example of usage of this enctype: > > >> > > >> http://yaws.hyber.org/upload0.yaws > > >> > > >> Sean > > >> > > >> > > > > > > > > > > From sean.hinde@REDACTED Tue Jun 14 19:14:16 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 14 Jun 2005 18:14:16 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <012301c57102$dc33e930$4a00a8c0@Inswitch251> References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> Message-ID: <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> I didn't mean yaws, I meant the patch to the SSL driver: http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 Sean On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: > Hi Sean, > > I have installed the latest Yaws 1.55 but it doesn't work neither. > Using upload.yaws I've seen that with small files (4kb) the upload > works but > with larger ones no (120kb). > Any ideas? > > > thanks, > Eduardo Figoli > > > ----- Original Message ----- > From: "Inswitch Solutions" > To: "Sean Hinde" > Cc: > Sent: Monday, June 13, 2005 5:53 PM > Subject: Re: Yaws + SSL + POST HTTP > > > >> No, will do. >> >> Thanks. >> Eduardo >> ----- Original Message ----- >> From: "Sean Hinde" >> To: "Inswitch Solutions" >> Cc: >> Sent: Monday, June 13, 2005 5:50 PM >> Subject: Re: Yaws + SSL + POST HTTP >> >> >> >>> Have you tried applying the patch to the SSL driver recently >>> described on the mailing list? >>> >>> Sean >>> >>> >>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: >>> >>> >>>> Hi Sean, >>>> >>>> Yes it works perfectly. >>>> >>>> Eduardo >>>> >>>> >>>> ----- Original Message ----- >>>> From: "Sean Hinde" >>>> To: "Inswitch Solutions" >>>> Cc: >>>> Sent: Monday, June 13, 2005 5:42 PM >>>> Subject: Re: Yaws + SSL + POST HTTP >>>> >>>> >>>> >>>> >>>>> >>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: >>>>> >>>>> >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm having problems with Yaws+SSL and the following HTML : >>>>>> >>>>> enctype="multipart/form-data"> >>>>>> >>>>>> The POST HTTP request over and SSL connection is not correctly >>>>>> been >>>>>> handled by the Yaws web server. >>>>>> Any ideas? Do I have to use another enc MIME-type? >>>>>> >>>>>> >>>>> >>>>> This looks fine. Does it work without SSL? >>>>> >>>>> See the file upload example for an example of usage of this >>>>> enctype: >>>>> >>>>> http://yaws.hyber.org/upload0.yaws >>>>> >>>>> Sean >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> > > > From todd@REDACTED Tue Jun 14 19:27:03 2005 From: todd@REDACTED (todd) Date: Tue, 14 Jun 2005 10:27:03 -0700 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <42AF1367.80205@possibility.com> Michael Williams wrote: >Erlang programmers use concurrency (processes) to program things which happen >independently at the same time. > >Other people use concurrency to let several CPU to process a chunk of data ("a >bunch of threads running arround a big shared data structure"). > >These two ways to "use" concurrency are fundamentally different. Bray is writing >about the second way to "use" concurrency" and possibly has never done any >programming which requires the "Erlang" way. My guess is that the multi-core >multi-threaded chip manuafacturers have probably yet to realise that there is a >market in Erlang type applications. SUN will shut up about this until they have >found some way to squeeze Java into Erlang type applications. > > You would think given sun's push on the grid architecture that they would be thinking of making erlang style changes to java. I'd like to see it happen. From erlang@REDACTED Tue Jun 14 19:34:41 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 14 Jun 2005 14:34:41 -0300 Subject: Yaws + SSL + POST HTTP References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> Message-ID: <013301c57107$659524b0$4a00a8c0@Inswitch251> Sean, I've tried to use 32*1024 (32kb) size as the patch does but it doesn't work also. In this case the same error ocurrs (the page cannot be shown). I've increased it to 130*1024 (130kb) and now it works correctly. It seems as in Win32 the yaws directive: . {get_more, Cont, State} is not working correctly. thanks again, Eduardo Figoli thanks, Eduardo Figoli ----- Original Message ----- From: "Sean Hinde" To: "Inswitch Solutions" Cc: Sent: Tuesday, June 14, 2005 2:14 PM Subject: Re: Yaws + SSL + POST HTTP > I didn't mean yaws, I meant the patch to the SSL driver: > > http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 > > Sean > > On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: > > > Hi Sean, > > > > I have installed the latest Yaws 1.55 but it doesn't work neither. > > Using upload.yaws I've seen that with small files (4kb) the upload > > works but > > with larger ones no (120kb). > > Any ideas? > > > > > > thanks, > > Eduardo Figoli > > > > > > ----- Original Message ----- > > From: "Inswitch Solutions" > > To: "Sean Hinde" > > Cc: > > Sent: Monday, June 13, 2005 5:53 PM > > Subject: Re: Yaws + SSL + POST HTTP > > > > > > > >> No, will do. > >> > >> Thanks. > >> Eduardo > >> ----- Original Message ----- > >> From: "Sean Hinde" > >> To: "Inswitch Solutions" > >> Cc: > >> Sent: Monday, June 13, 2005 5:50 PM > >> Subject: Re: Yaws + SSL + POST HTTP > >> > >> > >> > >>> Have you tried applying the patch to the SSL driver recently > >>> described on the mailing list? > >>> > >>> Sean > >>> > >>> > >>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > >>> > >>> > >>>> Hi Sean, > >>>> > >>>> Yes it works perfectly. > >>>> > >>>> Eduardo > >>>> > >>>> > >>>> ----- Original Message ----- > >>>> From: "Sean Hinde" > >>>> To: "Inswitch Solutions" > >>>> Cc: > >>>> Sent: Monday, June 13, 2005 5:42 PM > >>>> Subject: Re: Yaws + SSL + POST HTTP > >>>> > >>>> > >>>> > >>>> > >>>>> > >>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > >>>>> > >>>>> > >>>>> > >>>>>> Hi, > >>>>>> > >>>>>> I'm having problems with Yaws+SSL and the following HTML : > >>>>>> >>>>>> enctype="multipart/form-data"> > >>>>>> > >>>>>> The POST HTTP request over and SSL connection is not correctly > >>>>>> been > >>>>>> handled by the Yaws web server. > >>>>>> Any ideas? Do I have to use another enc MIME-type? > >>>>>> > >>>>>> > >>>>> > >>>>> This looks fine. Does it work without SSL? > >>>>> > >>>>> See the file upload example for an example of usage of this > >>>>> enctype: > >>>>> > >>>>> http://yaws.hyber.org/upload0.yaws > >>>>> > >>>>> Sean > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > > > > > > > > From sean.hinde@REDACTED Tue Jun 14 20:06:58 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 14 Jun 2005 19:06:58 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <013301c57107$659524b0$4a00a8c0@Inswitch251> References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> <013301c57107$659524b0$4a00a8c0@Inswitch251> Message-ID: How did you apply the patch? did you actually re-compile esock.c and the ssl driver under windows? Using cygwin? Sean On 14 Jun 2005, at 18:34, Inswitch Solutions wrote: > Sean, > > I've tried to use 32*1024 (32kb) size as the patch does but it > doesn't work > also. > In this case the same error ocurrs (the page cannot be shown). > > I've increased it to 130*1024 (130kb) and now it works correctly. > It seems as in Win32 the yaws directive: > . {get_more, Cont, State} > > is not working correctly. > > > > thanks again, Eduardo Figoli > > > > > > thanks, > Eduardo Figoli > > > ----- Original Message ----- > From: "Sean Hinde" > To: "Inswitch Solutions" > Cc: > Sent: Tuesday, June 14, 2005 2:14 PM > Subject: Re: Yaws + SSL + POST HTTP > > > >> I didn't mean yaws, I meant the patch to the SSL driver: >> >> http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 >> >> Sean >> >> On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: >> >> >>> Hi Sean, >>> >>> I have installed the latest Yaws 1.55 but it doesn't work neither. >>> Using upload.yaws I've seen that with small files (4kb) the upload >>> works but >>> with larger ones no (120kb). >>> Any ideas? >>> >>> >>> thanks, >>> Eduardo Figoli >>> >>> >>> ----- Original Message ----- >>> From: "Inswitch Solutions" >>> To: "Sean Hinde" >>> Cc: >>> Sent: Monday, June 13, 2005 5:53 PM >>> Subject: Re: Yaws + SSL + POST HTTP >>> >>> >>> >>> >>>> No, will do. >>>> >>>> Thanks. >>>> Eduardo >>>> ----- Original Message ----- >>>> From: "Sean Hinde" >>>> To: "Inswitch Solutions" >>>> Cc: >>>> Sent: Monday, June 13, 2005 5:50 PM >>>> Subject: Re: Yaws + SSL + POST HTTP >>>> >>>> >>>> >>>> >>>>> Have you tried applying the patch to the SSL driver recently >>>>> described on the mailing list? >>>>> >>>>> Sean >>>>> >>>>> >>>>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: >>>>> >>>>> >>>>> >>>>>> Hi Sean, >>>>>> >>>>>> Yes it works perfectly. >>>>>> >>>>>> Eduardo >>>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "Sean Hinde" >>>>>> To: "Inswitch Solutions" >>>>>> Cc: >>>>>> Sent: Monday, June 13, 2005 5:42 PM >>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm having problems with Yaws+SSL and the following HTML : >>>>>>>> >>>>>>> enctype="multipart/form-data"> >>>>>>>> >>>>>>>> The POST HTTP request over and SSL connection is not correctly >>>>>>>> been >>>>>>>> handled by the Yaws web server. >>>>>>>> Any ideas? Do I have to use another enc MIME-type? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> This looks fine. Does it work without SSL? >>>>>>> >>>>>>> See the file upload example for an example of usage of this >>>>>>> enctype: >>>>>>> >>>>>>> http://yaws.hyber.org/upload0.yaws >>>>>>> >>>>>>> Sean >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>> >>> >>> >>> >> >> >> > > > From thomasl_erlang@REDACTED Tue Jun 14 20:13:14 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 14 Jun 2005 11:13:14 -0700 (PDT) Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: Message-ID: <20050614181314.89020.qmail@web41902.mail.yahoo.com> --- "Joe Armstrong (AL/EAB)" wrote: > This thread has a crazy title "Getting concurrency" > - this implies people just don't get it > > The title should be "Getting locks and sharing" - > now that's the stuff I just don't get > try and make locks and shared data work in the > presence of failure - now that *is* > a nightmare. Just getting all the details right in the ordinary execution scenario isn't trivial, either in theory or practice. That's what I mean by "getting it": reliably producing good-quality code concerning "it". Failures add extra spice to this, of course. > Concurrency IS - that's how the world is - things > happen in parallel. ... > You can program perfectly well without locks and > sharing just by using message passing to both > communicate and synchronise - the code is simple and > easy to understand. > > Currency isn't difficult to "get" - but locks and > sharing are However, as programmers we are in the business of orchestrating these happenings in some detail, not just experiencing them. Even if you are programming with failure-free message passing, you still have to consider race conditions, or (more generally) event interleavings in your system. And you will in principle have to consider all possible such interleavings, or worse. (Worse when your notion of time does not even include "interleaving".) Some of these interleavings may manifest failures of some sort (e.g., trying to send to a process or service which hasn't started yet, or which has terminated). Others can result in deadlocks or crashes (e.g., receiving messages in an order the recipient did not plan for). And so on. While I would definitely say message passing makes this reasoning easier, it can still be a formidable task. And don't forget other aspects such as efficiency, scalability, reusability, maintainability, ... E.g., "Does this highly optimized design I inherited actually work? What if I also have to implement these new requirements?" etc. Experience, "getting it", individually and collectively, will help in overcoming this ... but at this time, I don't think we're there. Best, Thomas __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail From erlang@REDACTED Tue Jun 14 20:27:58 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 14 Jun 2005 15:27:58 -0300 Subject: Yaws + SSL + POST HTTP References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> <013301c57107$659524b0$4a00a8c0@Inswitch251> Message-ID: <014f01c5710e$d1becb30$4a00a8c0@Inswitch251> I've recompiled under win32 (Windows 2000) the SSL port.(ssl_esock)with #define RWBUFLEN 120*1024 in esock.c. This buffer value elimantes the need for {get_more, Cont, State} on HTTP read when trying to upload a file of 120kb. regards, Eduardo ----- Original Message ----- From: "Sean Hinde" To: "Inswitch Solutions" Cc: Sent: Tuesday, June 14, 2005 3:06 PM Subject: Re: Yaws + SSL + POST HTTP > How did you apply the patch? did you actually re-compile esock.c and > the ssl driver under windows? Using cygwin? > > Sean > > On 14 Jun 2005, at 18:34, Inswitch Solutions wrote: > > > Sean, > > > > I've tried to use 32*1024 (32kb) size as the patch does but it > > doesn't work > > also. > > In this case the same error ocurrs (the page cannot be shown). > > > > I've increased it to 130*1024 (130kb) and now it works correctly. > > It seems as in Win32 the yaws directive: > > . {get_more, Cont, State} > > > > is not working correctly. > > > > > > > > thanks again, Eduardo Figoli > > > > > > > > > > > > thanks, > > Eduardo Figoli > > > > > > ----- Original Message ----- > > From: "Sean Hinde" > > To: "Inswitch Solutions" > > Cc: > > Sent: Tuesday, June 14, 2005 2:14 PM > > Subject: Re: Yaws + SSL + POST HTTP > > > > > > > >> I didn't mean yaws, I meant the patch to the SSL driver: > >> > >> http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 > >> > >> Sean > >> > >> On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: > >> > >> > >>> Hi Sean, > >>> > >>> I have installed the latest Yaws 1.55 but it doesn't work neither. > >>> Using upload.yaws I've seen that with small files (4kb) the upload > >>> works but > >>> with larger ones no (120kb). > >>> Any ideas? > >>> > >>> > >>> thanks, > >>> Eduardo Figoli > >>> > >>> > >>> ----- Original Message ----- > >>> From: "Inswitch Solutions" > >>> To: "Sean Hinde" > >>> Cc: > >>> Sent: Monday, June 13, 2005 5:53 PM > >>> Subject: Re: Yaws + SSL + POST HTTP > >>> > >>> > >>> > >>> > >>>> No, will do. > >>>> > >>>> Thanks. > >>>> Eduardo > >>>> ----- Original Message ----- > >>>> From: "Sean Hinde" > >>>> To: "Inswitch Solutions" > >>>> Cc: > >>>> Sent: Monday, June 13, 2005 5:50 PM > >>>> Subject: Re: Yaws + SSL + POST HTTP > >>>> > >>>> > >>>> > >>>> > >>>>> Have you tried applying the patch to the SSL driver recently > >>>>> described on the mailing list? > >>>>> > >>>>> Sean > >>>>> > >>>>> > >>>>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > >>>>> > >>>>> > >>>>> > >>>>>> Hi Sean, > >>>>>> > >>>>>> Yes it works perfectly. > >>>>>> > >>>>>> Eduardo > >>>>>> > >>>>>> > >>>>>> ----- Original Message ----- > >>>>>> From: "Sean Hinde" > >>>>>> To: "Inswitch Solutions" > >>>>>> Cc: > >>>>>> Sent: Monday, June 13, 2005 5:42 PM > >>>>>> Subject: Re: Yaws + SSL + POST HTTP > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> > >>>>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> Hi, > >>>>>>>> > >>>>>>>> I'm having problems with Yaws+SSL and the following HTML : > >>>>>>>> >>>>>>>> enctype="multipart/form-data"> > >>>>>>>> > >>>>>>>> The POST HTTP request over and SSL connection is not correctly > >>>>>>>> been > >>>>>>>> handled by the Yaws web server. > >>>>>>>> Any ideas? Do I have to use another enc MIME-type? > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>>> This looks fine. Does it work without SSL? > >>>>>>> > >>>>>>> See the file upload example for an example of usage of this > >>>>>>> enctype: > >>>>>>> > >>>>>>> http://yaws.hyber.org/upload0.yaws > >>>>>>> > >>>>>>> Sean > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>> > >>> > >>> > >>> > >> > >> > >> > > > > > > > > From sean.hinde@REDACTED Tue Jun 14 20:35:35 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 14 Jun 2005 19:35:35 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <014f01c5710e$d1becb30$4a00a8c0@Inswitch251> References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> <013301c57107$659524b0$4a00a8c0@Inswitch251> <014f01c5710e$d1becb30$4a00a8c0@Inswitch251> Message-ID: Interesting. {get_more, Cont, State} should only ever be required when the partial_post_size configuration is set. It should have nothing to do with the SSL buffer size - without this config Yaws will accumulate the whole POST body and deliver it to the callback in one piece. So, do you have the partial_post_size Yaws config parameter set? If so does it work without this (or with it set to the atom 'nolimit') but with the smaller SSL buffer size? Sean On 14 Jun 2005, at 19:27, Inswitch Solutions wrote: > > I've recompiled under win32 (Windows 2000) the SSL port.(ssl_esock) > with > #define RWBUFLEN 120*1024 > in esock.c. This buffer value elimantes the need for {get_more, > Cont, > State} on HTTP read when trying to upload a file of 120kb. > > > regards, Eduardo > > > ----- Original Message ----- > From: "Sean Hinde" > To: "Inswitch Solutions" > Cc: > Sent: Tuesday, June 14, 2005 3:06 PM > Subject: Re: Yaws + SSL + POST HTTP > > > >> How did you apply the patch? did you actually re-compile esock.c and >> the ssl driver under windows? Using cygwin? >> >> Sean >> >> On 14 Jun 2005, at 18:34, Inswitch Solutions wrote: >> >> >>> Sean, >>> >>> I've tried to use 32*1024 (32kb) size as the patch does but it >>> doesn't work >>> also. >>> In this case the same error ocurrs (the page cannot be shown). >>> >>> I've increased it to 130*1024 (130kb) and now it works correctly. >>> It seems as in Win32 the yaws directive: >>> . {get_more, Cont, State} >>> >>> is not working correctly. >>> >>> >>> >>> thanks again, Eduardo Figoli >>> >>> >>> >>> >>> >>> thanks, >>> Eduardo Figoli >>> >>> >>> ----- Original Message ----- >>> From: "Sean Hinde" >>> To: "Inswitch Solutions" >>> Cc: >>> Sent: Tuesday, June 14, 2005 2:14 PM >>> Subject: Re: Yaws + SSL + POST HTTP >>> >>> >>> >>> >>>> I didn't mean yaws, I meant the patch to the SSL driver: >>>> >>>> http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 >>>> >>>> Sean >>>> >>>> On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: >>>> >>>> >>>> >>>>> Hi Sean, >>>>> >>>>> I have installed the latest Yaws 1.55 but it doesn't work neither. >>>>> Using upload.yaws I've seen that with small files (4kb) the upload >>>>> works but >>>>> with larger ones no (120kb). >>>>> Any ideas? >>>>> >>>>> >>>>> thanks, >>>>> Eduardo Figoli >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: "Inswitch Solutions" >>>>> To: "Sean Hinde" >>>>> Cc: >>>>> Sent: Monday, June 13, 2005 5:53 PM >>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> No, will do. >>>>>> >>>>>> Thanks. >>>>>> Eduardo >>>>>> ----- Original Message ----- >>>>>> From: "Sean Hinde" >>>>>> To: "Inswitch Solutions" >>>>>> Cc: >>>>>> Sent: Monday, June 13, 2005 5:50 PM >>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Have you tried applying the patch to the SSL driver recently >>>>>>> described on the mailing list? >>>>>>> >>>>>>> Sean >>>>>>> >>>>>>> >>>>>>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Hi Sean, >>>>>>>> >>>>>>>> Yes it works perfectly. >>>>>>>> >>>>>>>> Eduardo >>>>>>>> >>>>>>>> >>>>>>>> ----- Original Message ----- >>>>>>>> From: "Sean Hinde" >>>>>>>> To: "Inswitch Solutions" >>>>>>>> Cc: >>>>>>>> Sent: Monday, June 13, 2005 5:42 PM >>>>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I'm having problems with Yaws+SSL and the following HTML : >>>>>>>>>> >>>>>>>>> enctype="multipart/form-data"> >>>>>>>>>> >>>>>>>>>> The POST HTTP request over and SSL connection is not >>>>>>>>>> correctly >>>>>>>>>> been >>>>>>>>>> handled by the Yaws web server. >>>>>>>>>> Any ideas? Do I have to use another enc MIME-type? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> This looks fine. Does it work without SSL? >>>>>>>>> >>>>>>>>> See the file upload example for an example of usage of this >>>>>>>>> enctype: >>>>>>>>> >>>>>>>>> http://yaws.hyber.org/upload0.yaws >>>>>>>>> >>>>>>>>> Sean >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> > > > From erlang@REDACTED Tue Jun 14 20:44:40 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Tue, 14 Jun 2005 15:44:40 -0300 Subject: Yaws + SSL + POST HTTP References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> <013301c57107$659524b0$4a00a8c0@Inswitch251> <014f01c5710e$d1becb30$4a00a8c0@Inswitch251> Message-ID: <016701c57111$230e7560$4a00a8c0@Inswitch251> I didn't know about Yaws partial_post_size parameter. Is it 'nolimit' the default value? Which value should I set it to? Eduardo ----- Original Message ----- From: "Sean Hinde" To: "Inswitch Solutions" Cc: Sent: Tuesday, June 14, 2005 3:35 PM Subject: Re: Yaws + SSL + POST HTTP > Interesting. > > {get_more, Cont, State} should only ever be required when the > partial_post_size configuration is set. It should have nothing to do > with the SSL buffer size - without this config Yaws will accumulate > the whole POST body and deliver it to the callback in one piece. > > So, do you have the partial_post_size Yaws config parameter set? If > so does it work without this (or with it set to the atom 'nolimit') > but with the smaller SSL buffer size? > > Sean > > On 14 Jun 2005, at 19:27, Inswitch Solutions wrote: > > > > > I've recompiled under win32 (Windows 2000) the SSL port.(ssl_esock) > > with > > #define RWBUFLEN 120*1024 > > in esock.c. This buffer value elimantes the need for {get_more, > > Cont, > > State} on HTTP read when trying to upload a file of 120kb. > > > > > > regards, Eduardo > > > > > > ----- Original Message ----- > > From: "Sean Hinde" > > To: "Inswitch Solutions" > > Cc: > > Sent: Tuesday, June 14, 2005 3:06 PM > > Subject: Re: Yaws + SSL + POST HTTP > > > > > > > >> How did you apply the patch? did you actually re-compile esock.c and > >> the ssl driver under windows? Using cygwin? > >> > >> Sean > >> > >> On 14 Jun 2005, at 18:34, Inswitch Solutions wrote: > >> > >> > >>> Sean, > >>> > >>> I've tried to use 32*1024 (32kb) size as the patch does but it > >>> doesn't work > >>> also. > >>> In this case the same error ocurrs (the page cannot be shown). > >>> > >>> I've increased it to 130*1024 (130kb) and now it works correctly. > >>> It seems as in Win32 the yaws directive: > >>> . {get_more, Cont, State} > >>> > >>> is not working correctly. > >>> > >>> > >>> > >>> thanks again, Eduardo Figoli > >>> > >>> > >>> > >>> > >>> > >>> thanks, > >>> Eduardo Figoli > >>> > >>> > >>> ----- Original Message ----- > >>> From: "Sean Hinde" > >>> To: "Inswitch Solutions" > >>> Cc: > >>> Sent: Tuesday, June 14, 2005 2:14 PM > >>> Subject: Re: Yaws + SSL + POST HTTP > >>> > >>> > >>> > >>> > >>>> I didn't mean yaws, I meant the patch to the SSL driver: > >>>> > >>>> http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 > >>>> > >>>> Sean > >>>> > >>>> On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: > >>>> > >>>> > >>>> > >>>>> Hi Sean, > >>>>> > >>>>> I have installed the latest Yaws 1.55 but it doesn't work neither. > >>>>> Using upload.yaws I've seen that with small files (4kb) the upload > >>>>> works but > >>>>> with larger ones no (120kb). > >>>>> Any ideas? > >>>>> > >>>>> > >>>>> thanks, > >>>>> Eduardo Figoli > >>>>> > >>>>> > >>>>> ----- Original Message ----- > >>>>> From: "Inswitch Solutions" > >>>>> To: "Sean Hinde" > >>>>> Cc: > >>>>> Sent: Monday, June 13, 2005 5:53 PM > >>>>> Subject: Re: Yaws + SSL + POST HTTP > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>> No, will do. > >>>>>> > >>>>>> Thanks. > >>>>>> Eduardo > >>>>>> ----- Original Message ----- > >>>>>> From: "Sean Hinde" > >>>>>> To: "Inswitch Solutions" > >>>>>> Cc: > >>>>>> Sent: Monday, June 13, 2005 5:50 PM > >>>>>> Subject: Re: Yaws + SSL + POST HTTP > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> Have you tried applying the patch to the SSL driver recently > >>>>>>> described on the mailing list? > >>>>>>> > >>>>>>> Sean > >>>>>>> > >>>>>>> > >>>>>>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>> Hi Sean, > >>>>>>>> > >>>>>>>> Yes it works perfectly. > >>>>>>>> > >>>>>>>> Eduardo > >>>>>>>> > >>>>>>>> > >>>>>>>> ----- Original Message ----- > >>>>>>>> From: "Sean Hinde" > >>>>>>>> To: "Inswitch Solutions" > >>>>>>>> Cc: > >>>>>>>> Sent: Monday, June 13, 2005 5:42 PM > >>>>>>>> Subject: Re: Yaws + SSL + POST HTTP > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>>> > >>>>>>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>>> Hi, > >>>>>>>>>> > >>>>>>>>>> I'm having problems with Yaws+SSL and the following HTML : > >>>>>>>>>> >>>>>>>>>> enctype="multipart/form-data"> > >>>>>>>>>> > >>>>>>>>>> The POST HTTP request over and SSL connection is not > >>>>>>>>>> correctly > >>>>>>>>>> been > >>>>>>>>>> handled by the Yaws web server. > >>>>>>>>>> Any ideas? Do I have to use another enc MIME-type? > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>> > >>>>>>>>> This looks fine. Does it work without SSL? > >>>>>>>>> > >>>>>>>>> See the file upload example for an example of usage of this > >>>>>>>>> enctype: > >>>>>>>>> > >>>>>>>>> http://yaws.hyber.org/upload0.yaws > >>>>>>>>> > >>>>>>>>> Sean > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>> > >> > >> > >> > > > > > > > > From sean.hinde@REDACTED Tue Jun 14 21:08:52 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 14 Jun 2005 20:08:52 +0100 Subject: Yaws + SSL + POST HTTP In-Reply-To: <016701c57111$230e7560$4a00a8c0@Inswitch251> References: <012301c57102$dc33e930$4a00a8c0@Inswitch251> <4615E19C-3825-48D8-B842-2BFCD1DEF2E0@mac.com> <013301c57107$659524b0$4a00a8c0@Inswitch251> <014f01c5710e$d1becb30$4a00a8c0@Inswitch251> <016701c57111$230e7560$4a00a8c0@Inswitch251> Message-ID: nolimit is the default yes. So in your case you should never need to return {get_more..} at all. In fact I don't think it will work if you do return this if you don't need to. Perhaps you can run this test with debug enabled in yaws and post any interesting results to the Yaws mailing list. Otherwise it does seem like a bug in Win32 Erlang. Sean On 14 Jun 2005, at 19:44, Inswitch Solutions wrote: > I didn't know about Yaws partial_post_size parameter. > Is it 'nolimit' the default value? Which value should I set it to? > > > Eduardo > > > ----- Original Message ----- > From: "Sean Hinde" > To: "Inswitch Solutions" > Cc: > Sent: Tuesday, June 14, 2005 3:35 PM > Subject: Re: Yaws + SSL + POST HTTP > > > >> Interesting. >> >> {get_more, Cont, State} should only ever be required when the >> partial_post_size configuration is set. It should have nothing to do >> with the SSL buffer size - without this config Yaws will accumulate >> the whole POST body and deliver it to the callback in one piece. >> >> So, do you have the partial_post_size Yaws config parameter set? If >> so does it work without this (or with it set to the atom 'nolimit') >> but with the smaller SSL buffer size? >> >> Sean >> >> On 14 Jun 2005, at 19:27, Inswitch Solutions wrote: >> >> >>> >>> I've recompiled under win32 (Windows 2000) the SSL port.(ssl_esock) >>> with >>> #define RWBUFLEN 120*1024 >>> in esock.c. This buffer value elimantes the need for {get_more, >>> Cont, >>> State} on HTTP read when trying to upload a file of 120kb. >>> >>> >>> regards, Eduardo >>> >>> >>> ----- Original Message ----- >>> From: "Sean Hinde" >>> To: "Inswitch Solutions" >>> Cc: >>> Sent: Tuesday, June 14, 2005 3:06 PM >>> Subject: Re: Yaws + SSL + POST HTTP >>> >>> >>> >>> >>>> How did you apply the patch? did you actually re-compile esock.c >>>> and >>>> the ssl driver under windows? Using cygwin? >>>> >>>> Sean >>>> >>>> On 14 Jun 2005, at 18:34, Inswitch Solutions wrote: >>>> >>>> >>>> >>>>> Sean, >>>>> >>>>> I've tried to use 32*1024 (32kb) size as the patch does but it >>>>> doesn't work >>>>> also. >>>>> In this case the same error ocurrs (the page cannot be shown). >>>>> >>>>> I've increased it to 130*1024 (130kb) and now it works correctly. >>>>> It seems as in Win32 the yaws directive: >>>>> . {get_more, Cont, State} >>>>> >>>>> is not working correctly. >>>>> >>>>> >>>>> >>>>> thanks again, Eduardo Figoli >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> thanks, >>>>> Eduardo Figoli >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: "Sean Hinde" >>>>> To: "Inswitch Solutions" >>>>> Cc: >>>>> Sent: Tuesday, June 14, 2005 2:14 PM >>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> I didn't mean yaws, I meant the patch to the SSL driver: >>>>>> >>>>>> http://forums.trapexit.org:81/phpBB/viewtopic.php?t=4870 >>>>>> >>>>>> Sean >>>>>> >>>>>> On 14 Jun 2005, at 18:02, Inswitch Solutions wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Hi Sean, >>>>>>> >>>>>>> I have installed the latest Yaws 1.55 but it doesn't work >>>>>>> neither. >>>>>>> Using upload.yaws I've seen that with small files (4kb) the >>>>>>> upload >>>>>>> works but >>>>>>> with larger ones no (120kb). >>>>>>> Any ideas? >>>>>>> >>>>>>> >>>>>>> thanks, >>>>>>> Eduardo Figoli >>>>>>> >>>>>>> >>>>>>> ----- Original Message ----- >>>>>>> From: "Inswitch Solutions" >>>>>>> To: "Sean Hinde" >>>>>>> Cc: >>>>>>> Sent: Monday, June 13, 2005 5:53 PM >>>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> No, will do. >>>>>>>> >>>>>>>> Thanks. >>>>>>>> Eduardo >>>>>>>> ----- Original Message ----- >>>>>>>> From: "Sean Hinde" >>>>>>>> To: "Inswitch Solutions" >>>>>>>> Cc: >>>>>>>> Sent: Monday, June 13, 2005 5:50 PM >>>>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Have you tried applying the patch to the SSL driver recently >>>>>>>>> described on the mailing list? >>>>>>>>> >>>>>>>>> Sean >>>>>>>>> >>>>>>>>> >>>>>>>>> On 13 Jun 2005, at 21:45, Inswitch Solutions wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>>> Hi Sean, >>>>>>>>>> >>>>>>>>>> Yes it works perfectly. >>>>>>>>>> >>>>>>>>>> Eduardo >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ----- Original Message ----- >>>>>>>>>> From: "Sean Hinde" >>>>>>>>>> To: "Inswitch Solutions" >>>>>>>>>> Cc: >>>>>>>>>> Sent: Monday, June 13, 2005 5:42 PM >>>>>>>>>> Subject: Re: Yaws + SSL + POST HTTP >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 13 Jun 2005, at 21:12, Inswitch Solutions wrote: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> I'm having problems with Yaws+SSL and the following HTML : >>>>>>>>>>>> >>>>>>>>>>> enctype="multipart/form-data"> >>>>>>>>>>>> >>>>>>>>>>>> The POST HTTP request over and SSL connection is not >>>>>>>>>>>> correctly >>>>>>>>>>>> been >>>>>>>>>>>> handled by the Yaws web server. >>>>>>>>>>>> Any ideas? Do I have to use another enc MIME-type? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> This looks fine. Does it work without SSL? >>>>>>>>>>> >>>>>>>>>>> See the file upload example for an example of usage of this >>>>>>>>>>> enctype: >>>>>>>>>>> >>>>>>>>>>> http://yaws.hyber.org/upload0.yaws >>>>>>>>>>> >>>>>>>>>>> Sean >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> > > From complog@REDACTED Tue Jun 14 20:10:31 2005 From: complog@REDACTED (Logic Programming Rsrch Association) Date: Tue, 14 Jun 2005 12:10:31 -0600 Subject: PADL 2006 -- CALL FOR PAPERS Message-ID: <42AF1D97.mail4BE1115YJ@pippo> A non-text attachment was scrubbed... Name: not available Type: application/octet-stream Size: 4303 bytes Desc: not available URL: From ulf@REDACTED Tue Jun 14 23:13:24 2005 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 14 Jun 2005 23:13:24 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <20050614181314.89020.qmail@web41902.mail.yahoo.com> References: <20050614181314.89020.qmail@web41902.mail.yahoo.com> Message-ID: Den 2005-06-14 20:13:14 skrev Thomas Lindgren : > And don't forget other aspects such as efficiency, > scalability, reusability, maintainability, ... E.g., > "Does this highly optimized design I inherited > actually work? What if I also have to implement these > new requirements?" etc. I think one approach to seriously consider is to forget about making code "highly optimized", when we're talking about grid computers and multi-core architectures. Focus on writing conservative code and choosing safe concurrency patterns. When it comes to concurrency, optimization is truly the root of all evil. Use all those CPUs to buy yourselves the luxury to write safe code for a change, rather than cutting corners. ;-) /Uffe From martin.ankerl@REDACTED Wed Jun 15 00:48:35 2005 From: martin.ankerl@REDACTED (Martin Ankerl) Date: Wed, 15 Jun 2005 00:48:35 +0200 Subject: Erlang reference card? Message-ID: Hi, does some kind of erlang quick reference card exist? It would be quite helpful for erlang newbies like me. -- Martin Ankerl | http://martinus.geekisp.com/ From ke.han@REDACTED Wed Jun 15 05:50:14 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 15 Jun 2005 11:50:14 +0800 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: <20050614181314.89020.qmail@web41902.mail.yahoo.com> Message-ID: <42AFA576.304@redstarling.com> I agree with Ulf and Joe on the issue that erlang solves concurrency in a cleaner fashion for real world business problems. I have built very tedious Java applications and systems frameworks to remove threading issues from the app programmer. Its a very difficult job. I'm very hapy with my switch to erlang. The Bray blog post dismisses erlang too easily but you will see this type of dismissal continue in other ways if erlang doesn't "grow" in ways to meet the multi-core and multi-cpu market, Multi-core and multi-cpu system need to be supported with a single erlang node in order for the rest of the programming world to not quickly dismiss erlang. I've read the research paper on multi-cpu erlang...looks promising. Is there any chance of this becoming a real product? thanks, ke han Ulf Wiger wrote: > Den 2005-06-14 20:13:14 skrev Thomas Lindgren : > >> And don't forget other aspects such as efficiency, >> scalability, reusability, maintainability, ... E.g., >> "Does this highly optimized design I inherited >> actually work? What if I also have to implement these >> new requirements?" etc. > > > I think one approach to seriously consider is to > forget about making code "highly optimized", when > we're talking about grid computers and multi-core > architectures. Focus on writing conservative code > and choosing safe concurrency patterns. When it > comes to concurrency, optimization is truly the > root of all evil. Use all those CPUs to buy > yourselves the luxury to write safe code for a change, > rather than cutting corners. ;-) > > /Uffe > > From wilson.sh.tam@REDACTED Wed Jun 15 08:16:20 2005 From: wilson.sh.tam@REDACTED (Wilson Tam) Date: Wed, 15 Jun 2005 14:16:20 +0800 Subject: No subject Message-ID: Hi, I recently updated the inets from 4.0.1 to 4.4. The http client's request pipeline function seems not working. I may miss some setting. Can anyone help? Here is what happened, I tried to run a command from the prompt: 3> http:request(get, {"http://192.168.0.207", []}, [], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Wed, 15 Jun 2005 05:56:58 GMT"}, {"server", "Apache/1.3.31 (Unix) PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/ 0.9.7d"}, {"content-length","936"}, {"content-type","text/html"}, {"x-powered-by","PHP/4.3.10"}, {"keep-alive","timeout=15, max=100"}],.... Everything is ok. And I repeat the same command again. 4> http:request(get, {"http://192.168.0.207", []}, [], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Wed, 15 Jun 2005 05:58:35 GMT"}, {"server", "Apache/1.3.31 (Unix) PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/ 0.9.7d"}, {"content-length","936"}, {"content-type","text/html"}, {"x-powered-by","PHP/4.3.10"}, {"keep-alive","timeout=15, max=100"}],... the result is also ok. But what happen is, on my apache log, it says: 18536 [2005-06-15 13:56:58] 192.168.0.171 [192.168.0.207] "GET / HTTP/ 1.1" 200 480 - - - 18545 [2005-06-15 13:58:35] 192.168.0.171 [192.168.0.207] "GET / HTTP/ 1.1" 200 480 - - - which says that they are connected to two different processes. And I keep repeating it, every time it create a new connection. The manual says the pipeline_timeout is set to zero by default. I tried to set it to 60sec 21> http:set_options([{pipeline_timeout, 60000}]). ok still, there is no different. All requests still make new connection. After that, I ran tcpdump to see who disconnect the connection. It shows that the client send a FIN packet. I'm not sure why the client will send the FIN. How can I make it to do pipeline as in 4.0.1?Can anyone help? Thanks, Willie From wilson.sh.tam@REDACTED Wed Jun 15 08:18:53 2005 From: wilson.sh.tam@REDACTED (Wilson Tam) Date: Wed, 15 Jun 2005 14:18:53 +0800 Subject: http client pipeline Message-ID: <6E7D8A39-258A-46E9-B5E3-C62D6CD0A628@gmail.com> Hi, I recently updated the inets from 4.0.1 to 4.4. The http client's request pipeline function seems not working. I may miss some setting. Can anyone help? Here is what happened, I tried to run a command from the prompt: 3> http:request(get, {"http://192.168.0.207", []}, [], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Wed, 15 Jun 2005 05:56:58 GMT"}, {"server", "Apache/1.3.31 (Unix) PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/ 0.9.7d"}, {"content-length","936"}, {"content-type","text/html"}, {"x-powered-by","PHP/4.3.10"}, {"keep-alive","timeout=15, max=100"}],.... Everything is ok. And I repeat the same command again. 4> http:request(get, {"http://192.168.0.207", []}, [], []). {ok,{{"HTTP/1.1",200,"OK"}, [{"connection","Keep-Alive"}, {"date","Wed, 15 Jun 2005 05:58:35 GMT"}, {"server", "Apache/1.3.31 (Unix) PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/ 0.9.7d"}, {"content-length","936"}, {"content-type","text/html"}, {"x-powered-by","PHP/4.3.10"}, {"keep-alive","timeout=15, max=100"}],... the result is also ok. But what happen is, on my apache log, it says: 18536 [2005-06-15 13:56:58] 192.168.0.171 [192.168.0.207] "GET / HTTP/ 1.1" 200 480 - - - 18545 [2005-06-15 13:58:35] 192.168.0.171 [192.168.0.207] "GET / HTTP/ 1.1" 200 480 - - - which says that they are connected to two different processes. And I keep repeating it, every time it create a new connection. The manual says the pipeline_timeout is set to zero by default. I tried to set it to 60sec 21> http:set_options([{pipeline_timeout, 60000}]). ok still, there is no different. All requests still make new connection. After that, I ran tcpdump to see who disconnect the connection. It shows that the client send a FIN packet. I'm not sure why the client will send the FIN. How can I make it to do pipeline as in 4.0.1?Can anyone help? Thanks, Willie From tpatro@REDACTED Wed Jun 15 08:35:00 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Wed, 15 Jun 2005 08:35:00 +0200 Subject: ESense 1.4 released In-Reply-To: References: Message-ID: Changes https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=335194 Files https://sourceforge.net/projects/esense/ Homepage http://esense.sourceforge.net/ From ingela@REDACTED Wed Jun 15 09:26:42 2005 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 15 Jun 2005 09:26:42 +0200 Subject: http client pipeline References: <6E7D8A39-258A-46E9-B5E3-C62D6CD0A628@gmail.com> Message-ID: <17071.55346.225874.388463@gargle.gargle.HOWL> Wilson Tam wrote: > I recently updated the inets from 4.0.1 to 4.4. The http client's > request pipeline function seems not working. I may miss some setting. > Can anyone help? [...] > How can I make it to do pipeline as in 4.0.1?Can anyone help? Change the function is_keep_alive_connection/2 in httc_handler.erl to look like this: is_keep_alive_connection(Headers, Session) -> (not ((Session#tcp_session.client_close) or httpc_response:is_server_closing(Headers))). In inets 4.0.1 the pipelining mechanism was a bit to optimistic alas in the process of making it more realistic it became broken! Hence some enchantments of the test suite will be needed as this little bug was missed. -- /m.v.h Ingela - OTP team From ingela@REDACTED Wed Jun 15 09:37:56 2005 From: ingela@REDACTED (Ingela Anderton) Date: Wed, 15 Jun 2005 09:37:56 +0200 Subject: inets http client url escaping References: <200506111647.20669.will@misconception.org.uk> Message-ID: <17071.56020.147245.283392@gargle.gargle.HOWL> Will Newton wrote: > > Is this expected behaviour? > 9> http:request(get, {"http://localhost/index.cgi?foo=%9F", []}, [], []). > {error,no_query} > > Is there a way to hex encode non 7-bit ASCII values in a path or query? I > haven't found a canonical source on what the correct way to do this, RFC 2396 > seems to leave it open, but I would expect to be able to do that. I do not know if it is the expected behavior! The uri-parsing is the one part of the http-client that has not at all been changed from the "prototype" (unsported version) that was contributed by Johan Blom. We will have to look into that. -- /Ingela - OTP team From wilson.sh.tam@REDACTED Wed Jun 15 10:34:50 2005 From: wilson.sh.tam@REDACTED (Wilson Tam) Date: Wed, 15 Jun 2005 16:34:50 +0800 Subject: http client pipeline In-Reply-To: <17071.57563.726120.463775@gargle.gargle.HOWL> References: <6E7D8A39-258A-46E9-B5E3-C62D6CD0A628@gmail.com> <17071.55346.225874.388463@gargle.gargle.HOWL> <252FE0B5-A18F-4224-8383-22D1A22C62BC@gmail.com> <17071.57563.726120.463775@gargle.gargle.HOWL> Message-ID: Thanks Ingela. Now it works perfect!. Sweet! On 15 Jun 2005, at 4:03 PM, Ingela Anderton wrote: > > Humm ... > > The last line of the following code was also changed in the same file. > > handle_call(Request, _, State = #state{session = Session = > #tcp_session{socket = Socket}, > timers = Timers, > options = Options}) -> > Address = handle_proxy(Request#request.address, > Options#options.proxy), > case httpc_request:send(Address, Request, Socket) of > ok -> > %% Activate the request time out for the new request > NewState = activate_request_timeout(State#state{request = > Request}), > > Before it said: > NewState = activate_request_timeout(State), > > which is wrong! > > I am not sure but that could be the problem! > > /Ingela > > > Wilson Tam wrote: > >> Thanks Ingela. >> > > >> >> I patched the file httpc_handler.erl and tried again. It pops some >> errors on the *second* request. The first one ran ok. I have also >> checked the apache log, it seems that it is still trying to make new >> connection. Any other hints? >> >> >> 56> http:request(get, {"http://192.168.0.207", []}, [], []). >> >> =ERROR REPORT==== 15-Jun-2005::15:44:12 === >> ** Generic server <0.146.0> terminating >> ** Last message in was {request,#Ref<0.0.0.685>, >> <0.71.0>, >> 0, >> http, >> {"192.168.0.207",80}, >> "/", >> [], >> get, >> {http_request_h, >> undefined, >> "keep-alive", >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> "192.168.0.207", >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> [], >> undefined, >> undefined, >> undefined, >> undefined, >> "0", >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> undefined, >> []}, >> {[],[]}, >> {http_options,infinity,true, >> [],false}, >> "http://192.168.0.207"} >> ** When Server state == {state,undefined, >> {tcp_session, >> {{"192.168.0.207",80},<0.146.0>}, >> false, >> http, >> #Port<0.158>, >> 1}, >> undefined, >> undefined, >> undefined, >> {httpc_response,parse,[nolimit]}, >> {[],[]}, >> pipeline, >> [], >> nolimit, >> nolimit, >> {options,{undefined,[]}, >> 60000,1,1,disabled}, >> {timers,[],#Ref<0.0.0.678>}} >> ** Reason for termination == >> ** {badarg,[{httpc_handler,activate_request_timeout,1}, >> {httpc_handler,handle_call,3}, >> {gen_server,handle_msg,6}, >> {proc_lib,init_p,5}]} >> {ok,{{"HTTP/1.1",200,"OK"}, >> [{"connection","Keep-Alive"}, >> {"date","Wed, 15 Jun 2005 07:44:15 GMT"}, >> {"server", >> "Apache/1.3.31 (Unix) PHP/4.3.10 mod_ssl/2.8.19 OpenSSL/ >> 0.9.7d"}, >> {"content-length","936"}, >> {"content-type","text/html"}, >> {"x-powered-by","PHP/4.3.10"}, >> {"keep-alive","timeout=15, max=100"}],.... >> >> >> >> >> >>> Change the function is_keep_alive_connection/2 in httc_handler.erl >>> to look like this: >>> >>> is_keep_alive_connection(Headers, Session) -> >>> (not ((Session#tcp_session.client_close) or >>> httpc_response:is_server_closing(Headers))). >>> >>> >>> In inets 4.0.1 the pipelining mechanism was a bit to optimistic >>> alas in the process of making it more realistic it became broken! >>> Hence some enchantments of the test suite will be needed as this >>> little bug was missed. >>> >>> -- >>> > > > > From rprice@REDACTED Wed Jun 15 11:26:41 2005 From: rprice@REDACTED (Roger Price) Date: Wed, 15 Jun 2005 11:26:41 +0200 (CEST) Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <42AFA576.304@redstarling.com> Message-ID: On Wed, 15 Jun 2005, ke.han wrote: > Multi-core and multi-cpu system need to be supported with a single > erlang node in order for the rest of the programming world to not > quickly dismiss erlang. I've read the research paper on multi-cpu > erlang...looks promising. Is there any chance of this becoming a real > product? Multi-cpu Erlang is a very attractive proposition. I bought a Dell Dimension 8400 sold as a single-CPU machine and replaced the M$ OS with Linux. SuSE Linux automatically installed a multi-processor kernel, and I see the two CPUs running concurrently in xosview. However the total load is never greater than 1. I am probably blocked by a single-CPU ATI proprietary graphics driver, and maybe other single-CPU stuff. However these road blocks will no doubt be removed and multi-CPU Erlang will then become very attractive. Roger From will@REDACTED Wed Jun 15 12:54:01 2005 From: will@REDACTED (Will Newton) Date: Wed, 15 Jun 2005 11:54:01 +0100 Subject: inets http client url escaping In-Reply-To: <17071.56020.147245.283392@gargle.gargle.HOWL> References: <200506111647.20669.will@misconception.org.uk> <17071.56020.147245.283392@gargle.gargle.HOWL> Message-ID: <200506151154.01821.will@misconception.org.uk> On Wednesday 15 June 2005 08:37, Ingela Anderton wrote: > > Is there a way to hex encode non 7-bit ASCII values in a path or query? I > > haven't found a canonical source on what the correct way to do this, RFC > > 2396 seems to leave it open, but I would expect to be able to do that. > > I do not know if it is the expected behavior! > The uri-parsing is the one part of the http-client that > has not at all been changed from the "prototype" (unsported version) > that was contributed by Johan Blom. We will have to look into that. Thanks. Does Erlang have a publically available issue tracker where issues like this one could be monitored? From ke.han@REDACTED Wed Jun 15 14:50:10 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 15 Jun 2005 20:50:10 +0800 Subject: Erlang reference card? In-Reply-To: <20050615110005.25D2E46ACB@bang.trapexit.org> References: <20050615110005.25D2E46ACB@bang.trapexit.org> Message-ID: <42B02402.8000901@redstarling.com> The trapexit howtos are very well written. I have read them all and cannot thank the contributors enough. Writting a complete howto is a time consuming process. Adding comments / examples to existing erlang docs is much easier. The MySQL documentation web site has the ability to post comments at the end of each doc page. Some of these comments are very useful to a person looking for answers. I often find the Erlang docs to be lacking usage examples and common answers which may or may not be found through mail list archives. Attaching user feedback to the original docs may help. I have seen posts on this mail list before asking how the Erlang docs are generated. No answers where given. If its not too hard, perhaps a MySQL like onlike doc facility can be added to trapexit. thanks, ke han tobbe wrote: > Hi, > > I don't think something like this exists. > It is however a splendid idea! > > I've been waiting now for Erlang aficionados to come up > with loads of HowTo documentation, ideas and/or proposals > on how to improve trapexit.org. That has not happend, why? > Are we still too few out there to get this kind of momentum? > > For example: on trapexit.org I would like to see: > > + A reference card page > + An auto FAQ > + A auto recepie collector (such as the Phyton cookbook, but as a Web-app) > + .... > > Any takers ? > > Cheers, Tobbe > _________________________________________________________ > Sent using Mail2Forum (http://m2f.sourceforge.net) > From james.hague@REDACTED Wed Jun 15 15:18:36 2005 From: james.hague@REDACTED (James Hague) Date: Wed, 15 Jun 2005 08:18:36 -0500 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: <42AFA576.304@redstarling.com> Message-ID: > Multi-cpu Erlang is a very attractive proposition. I agree. With AMD and Intel both pushing multiple cores on one chip, this looks like the time to resurrect the multi-CPU Erlang research. I fully expect that *all* desktops will have multiple CPUs within the next five years. (There are even rumors that, as part of the transition to Intel chips, Apple is only going to ship multi-CPU machines, including notebooks. We'll see.) From vances@REDACTED Wed Jun 15 15:57:04 2005 From: vances@REDACTED (Vance Shipley) Date: Wed, 15 Jun 2005 09:57:04 -0400 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: <42AFA576.304@redstarling.com> Message-ID: <20050615135703.GB46900@feeble.motivity.ca> On Wed, Jun 15, 2005 at 08:18:36AM -0500, James Hague wrote: } } I agree. With AMD and Intel both pushing multiple cores on one chip, } this looks like the time to resurrect the multi-CPU Erlang research. } I fully expect that *all* desktops will have multiple CPUs within the I'm convinced that the next ten years will see huge advances in parallelism. Sun's Niagra 32 way chip will ship soon. IBM et. al. have their cell processor. The low hanging fruit in performance gains is in adding parallel execution paths. I'm not talking dual CPU here but dozens or hundreds. Today's software industry isn't ready for that. It is inevitable that there will be a ground swell of interest in concurrency oriented programming languages. On the one hand I think Erlang stands a chance of gaining serious mind share. On the other hand the single threaded emulator will be seen as making the whole point moot. If Erlang doesn't deliver the goods new COPL language(s) will arise to solve the problem. That may well be a good thing but it would be a shame to see Erlang be passed by entirely. Maybe what we need in the short term is a wrapper application which takes care of creating nodes, binding them to virtual processors and generally making distribution transparent. -Vance From todd@REDACTED Wed Jun 15 16:31:49 2005 From: todd@REDACTED (todd) Date: Wed, 15 Jun 2005 07:31:49 -0700 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <20050615135703.GB46900@feeble.motivity.ca> References: <42AFA576.304@redstarling.com> <20050615135703.GB46900@feeble.motivity.ca> Message-ID: <42B03BD5.8040903@possibility.com> Vance Shipley wrote: >On Wed, Jun 15, 2005 at 08:18:36AM -0500, James Hague wrote: >} >} I agree. With AMD and Intel both pushing multiple cores on one chip, >} this looks like the time to resurrect the multi-CPU Erlang research. >} I fully expect that *all* desktops will have multiple CPUs within the > >I'm convinced that the next ten years will see huge advances in >parallelism. Sun's Niagra 32 way chip will ship soon. IBM et. al. >have their cell processor. > The cell processor cores are specialized, more like DSP processors. That's some of the conjecture as to why Apple didn't go with the cell, so it probably won't work well for a general OS. >The low hanging fruit in performance >gains is in adding parallel execution paths. I'm not talking dual >CPU here but dozens or hundreds. Today's software industry isn't >ready for that. > >Maybe what we need in the short term is a wrapper application which >takes care of creating nodes, binding them to virtual processors and >generally making distribution transparent. > > Would you make that integrate with typical OS processor scheduling mechanisms, or would it be something completely separate? From vances@REDACTED Wed Jun 15 16:53:40 2005 From: vances@REDACTED (Vance Shipley) Date: Wed, 15 Jun 2005 10:53:40 -0400 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <42B03BD5.8040903@possibility.com> References: <42AFA576.304@redstarling.com> <20050615135703.GB46900@feeble.motivity.ca> <42B03BD5.8040903@possibility.com> Message-ID: <20050615145340.GC46900@feeble.motivity.ca> On Wed, Jun 15, 2005 at 07:31:49AM -0700, todd wrote: } } Would you make that integrate with typical OS processor scheduling } mechanisms, or would it be something completely separate? I'm not suggesting anything that complicated just that the distribution would come with a version of "erl" which would detect the presence of multiple CPUs and start one node bound to each. In this way there is an easy, integrated, supported way of taking advantage of SMT. The two main points being that a) the user didn't need to think about it and b) the nodes are bound to specific CPUs instead of left to fend for themselves (not that I know anything about how this works). I'm not sure what to do after that. Do you make the "extra" nodes hidden and try and load share behind the scenes or do you just leave it at that and expect people to use normal erlang distribution? -Vance From olivier.sambourg@REDACTED Wed Jun 15 17:14:12 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Wed, 15 Jun 2005 17:14:12 +0200 Subject: JInterface question Message-ID: Hi everyone I'm trying to encapsulate erlang data inside an XMPP (jabber) stream and retrieve the data with a java client. So on the server side it looks like this : 1> httpd_util:encode_base64(binary_to_list(term_to_binary("test"))). "g2sABHRlc3Q=" And on the client side I've tried the following : OtpErlangString S = new OtpErlangString("test"); OtpOutputStream B = new OtpOutputStream(B); Base64.encodeObject(B.toByteArray()); -> "rO0ABXVyAAJbQqzzF/gGCFTgAgAAeHAAAAAHawAEdGVzdA==" Base64.encodeBytes(B.toByteArray()); -> "awAEdGVzdA==" Base64.encodeObject(B.toString()); -> "rO0ABXQALmNvbS5lcmljc3Nvbi5vdHAuZXJsYW5nLk90cE91dHB1dFN0cmVhbUBmNjQzOGQ=" I've also tried to build an OtpErlangBinary from the OtpOutputStream, then use the toString() method, to no avail... (I'm using the Base64 java library from http://iharder.sourceforge.net/base64/ but I guess the problem does not come from this) Do you have any suggestions to my problem ? I guess I'm just not using the right transformation in Java to reproduce the binary_to_list(term_to_binary()) operation... Thank you -- Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Wed Jun 15 17:24:20 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 15 Jun 2005 23:24:20 +0800 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <20050615135703.GB46900@feeble.motivity.ca> References: <42AFA576.304@redstarling.com> <20050615135703.GB46900@feeble.motivity.ca> Message-ID: <42B04824.1010703@redstarling.com> I did about a year of research on alternative languages before settling in on erlang for my current project. For this particular project, single cpu nodes works just fine. If I want more cpus, I can add more nodes with no need for replication of data/mnesia between the nodes. However, for many projects I've done in the past, I would have to specially architect the erlang solution to use distribution to make use of more CPU power. For most people investigating use of erlang, this architecture deviation to accommodate erlang will be too much considering they're already putting themselves at risk by choosing a niche language. I other words, the Bray blog post that instigated this thread says: "if I understand Erlang correctly, it abjures the use of global data, which simplifies the problems immensely. I?ve done a lot of concurrent work, and my biggest programming wins have been all about a bunch of threads running around a big shared data structure." With a multi-CPU single node erlang, you get the best of both worlds: you get the clean erlang programming model _and_ enabling multiple-CPUs access to the same big "shared" data. The only downside from doing this the "Bray way" is you have to buy more RAM for your server due to the erlang "process encapsulation" approach to accessing data. So, can we hear from experts that had hands-on experience with the mult-CPU erlang project?? What needs to be done to resurrect such a project? thanks, ke han Vance Shipley wrote: > On Wed, Jun 15, 2005 at 08:18:36AM -0500, James Hague wrote: > } > } I agree. With AMD and Intel both pushing multiple cores on one chip, > } this looks like the time to resurrect the multi-CPU Erlang research. > } I fully expect that *all* desktops will have multiple CPUs within the > > I'm convinced that the next ten years will see huge advances in > parallelism. Sun's Niagra 32 way chip will ship soon. IBM et. al. > have their cell processor. The low hanging fruit in performance > gains is in adding parallel execution paths. I'm not talking dual > CPU here but dozens or hundreds. Today's software industry isn't > ready for that. > > It is inevitable that there will be a ground swell of interest in > concurrency oriented programming languages. On the one hand I think > Erlang stands a chance of gaining serious mind share. On the other > hand the single threaded emulator will be seen as making the whole > point moot. > > If Erlang doesn't deliver the goods new COPL language(s) will arise > to solve the problem. That may well be a good thing but it would > be a shame to see Erlang be passed by entirely. > > Maybe what we need in the short term is a wrapper application which > takes care of creating nodes, binding them to virtual processors and > generally making distribution transparent. > > -Vance > From olivier.sambourg@REDACTED Wed Jun 15 18:33:42 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Wed, 15 Jun 2005 18:33:42 +0200 Subject: JInterface question In-Reply-To: References: Message-ID: Hi again I examined the data at byte level and here is what I found : 1> binary_to_list(term_to_binary("test")). [131,107,0,4,116,101,115,116] 2> binary_to_list(term_to_binary(test)). [131,100,0,4,116,101,115,116] 3> binary_to_list(term_to_binary({test, "test"})). [131,104,2,100,0,4,116,101,115,116,107,0,4,116,101,115,116] whereas : OtpErlangString S = new OtpErlangString("test"); OtpOutputStream B = new OtpOutputStream(S); B.toByteArray(); [107, 0, 4, 116, 101, 115, 116] OtpErlangAtom S = new OtpErlangAtom("test"); OtpOutputStream B = new OtpOutputStream(S); B.toByteArray(); [100, 0, 4, 116, 101, 115, 116] OtpErlangObject O[] = {new OtpErlangAtom("test"), new OtpErlangString("test")}; OtpErlangTuple T = new OtpErlangTuple(O); OtpOutputStream B = new OtpOutputStream(T); B.toByteArray(); [104, 2, 100, 0, 4, 116, 101, 115, 116, 107, 0, 4, 116, 101, 115, 116] It seems the only difference is the leading 131 byte in erlang. Can anyone confirm that it is always present ? If it is the case, I guess I have my solution. Thanks again, -- Olivier 2005/6/15, Olivier Sambourg : > > Hi everyone > > I'm trying to encapsulate erlang data inside an XMPP (jabber) stream and > retrieve the data with a java client. > So on the server side it looks like this : > > 1> httpd_util:encode_base64(binary_to_list(term_to_binary("test"))). > "g2sABHRlc3Q=" > > And on the client side I've tried the following : > OtpErlangString S = new OtpErlangString("test"); > OtpOutputStream B = new OtpOutputStream(B); > Base64.encodeObject(B.toByteArray()); -> > "rO0ABXVyAAJbQqzzF/gGCFTgAgAAeHAAAAAHawAEdGVzdA==" > Base64.encodeBytes(B.toByteArray()); -> "awAEdGVzdA==" > Base64.encodeObject(B.toString()); -> > "rO0ABXQALmNvbS5lcmljc3Nvbi5vdHAuZXJsYW5nLk90cE91dHB1dFN0cmVhbUBmNjQzOGQ=" > > I've also tried to build an OtpErlangBinary from the OtpOutputStream, then > use the toString() method, to no avail... > > (I'm using the Base64 java library from > http://iharder.sourceforge.net/base64/ but I guess the problem does not > come from this) > > Do you have any suggestions to my problem ? I guess I'm just not using the > right transformation in Java to reproduce the > binary_to_list(term_to_binary()) operation... > > Thank you > > -- > Olivier > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Jun 15 19:44:08 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 15 Jun 2005 10:44:08 -0700 (PDT) Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <20050615145340.GC46900@feeble.motivity.ca> Message-ID: <20050615174408.55298.qmail@web41904.mail.yahoo.com> --- Vance Shipley wrote: > I'm not suggesting anything that complicated just > that the distribution > would come with a version of "erl" which would > detect the presence of > multiple CPUs and start one node bound to each. In > this way there is > an easy, integrated, supported way of taking > advantage of SMT. The two > main points being that a) the user didn't need to > think about it and > b) the nodes are bound to specific CPUs instead of > left to fend for > themselves (not that I know anything about how this > works). > > I'm not sure what to do after that. Do you make the > "extra" nodes > hidden and try and load share behind the scenes or > do you just leave > it at that and expect people to use normal erlang > distribution? I think this sounds like a straightforward, simple way forward. We can start experimenting right now, then devise ways of simplifying and optimizing systems consisting of large numbers of (perhaps very closely connected) Erlang nodes as we gain experience. This approach seems like a low-hanging fruit to me. Best, Thomas __________________________________ Discover Yahoo! Use Yahoo! to plan a weekend, have fun online and more. Check it out! http://discover.yahoo.com/ From klacke@REDACTED Wed Jun 15 20:23:03 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 15 Jun 2005 20:23:03 +0200 Subject: Getting concurrency In-Reply-To: References: Message-ID: <42B07207.2020508@hyber.org> Ulf Wiger (AL/EAB) wrote: > Ignoring named tables, Which I thibk you should, minor detail. the performance difference between built-in > ets and erlang-based ets is quite small. Semantically, there are > no show stoppers. > Remember why we (I) did the ets tables in the first place. They were ment to be the main building block to build mnesia. It was (and still is) not easy to to have an erlang system which maintains huge amounts of data on the heap(s) ets tables were primarily a way to get non-gc'ed data space. As for speed, I remember that I worked a lot with various ways to let lookup() return a pointer instead of copying the whole thing. I couldn't ever get it to work well though. /klacke From vlad_dumitrescu@REDACTED Wed Jun 15 20:33:22 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 15 Jun 2005 20:33:22 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency References: <42AFA576.304@redstarling.com> <20050615135703.GB46900@feeble.motivity.ca> <42B03BD5.8040903@possibility.com> <20050615145340.GC46900@feeble.motivity.ca> Message-ID: From: "Vance Shipley" > I'm not sure what to do after that. Do you make the "extra" nodes > hidden and try and load share behind the scenes or do you just leave > it at that and expect people to use normal erlang distribution? Hi, My two cents on this, very sketchy. The most complex way is to make the mulator multi-CPU aware, with all the hassle involved. Just the distributed garbage collection could probably support a couple of Ph.D. theses. On the plus side, load balancing is automatic. The simplest way is to just strt several nodes, let them know about each other and leave it to the application developers to take advantage of the fact. In order for this to be useful, some kind of framework is needed to handle the housekeeping, like load balancing and a new global process registration. Applications must be multi-CPU aware, in order to use it. In-between I see another way, that I like most: let the framework be hidden behind the regular bifs, making the whole mechanism completely transparent. Then all applications could use it. Since it's integrated in the vm, it could do things better than an Erlang-only solution. What I think is needed at the most basic level is: - a spawn bif that does load balancing behind the scenes (but looks like a local spawn) - a way to let the node cluster look as just one node to the outside (including the global registration service), but still be able to identify each other. And I think it should be enough to get started... There's plenty of useful things to add later. What do you think? regards, Vlad From vlad_dumitrescu@REDACTED Wed Jun 15 20:49:08 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 15 Jun 2005 20:49:08 +0200 Subject: JInterface question References: Message-ID: ----- Original Message ----- From: Olivier Sambourg > It seems the only difference is the leading 131 byte in erlang. > Can anyone confirm that it is always present ? If it is the case, > I guess I have my solution. Hi, Yes, the 131 (*) is always there, because term_to_binary encodes into Erlang external format. See also $ERL_TOP/erts/emulator/internal_doc/erl_ext_dist.txt for details about the format, if you're interested. regards, Vlad (*) Future releases might change the actual value, I think, because it's a "version magic" field. From olivier.sambourg@REDACTED Wed Jun 15 21:29:22 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Wed, 15 Jun 2005 21:29:22 +0200 Subject: JInterface question In-Reply-To: References: Message-ID: <1CA2B2EC-3EA4-4894-8791-8A383CA2F587@gmail.com> Thank you, I'll check this doc. My only problem with this leading byte is that I have to manually add or remove it on the client side so that I can retrieve the data, even though the OtpInputStream and OtpOutputStream classes are supposed to be used to manipulate data in the Erlang external format. Am I missing something ? From the OtpOutputStream class documentation : Provides a stream for encoding Erlang terms to external format, for transmission or storage. Anyway my problem can be solved like this : public void sendObject(OtpErlangObject O) throws XMPPException { OtpOutputStream stream = new OtpOutputStream(); String data; stream.write((byte) 131); // add leading byte stream.write_any(O); data = Base64.encodeBytes(stream.toByteArray()); sendMessage(data); } public OtpErlangObject receiveObject(String encoded) throws OtpErlangDecodeException { byte[] decoded = Base64.decode(encoded); OtpInputStream stream = new OtpInputStream(decoded, 1, decoded.length - 1); // strip leading byte OtpErlangObject obj = OtpErlangObject.decode(stream); return obj; } Regards, -- Olivier Le 15 juin 05 ? 20:49, Vlad Dumitrescu a ?crit : > ----- Original Message ----- From: Olivier Sambourg > >> It seems the only difference is the leading 131 byte in erlang. >> Can anyone confirm that it is always present ? If it is the case, >> I guess I have my solution. >> > > Hi, > > Yes, the 131 (*) is always there, because term_to_binary encodes > into Erlang external format. > > See also $ERL_TOP/erts/emulator/internal_doc/erl_ext_dist.txt for > details about the format, if you're interested. > > regards, > Vlad > > (*) Future releases might change the actual value, I think, because > it's a "version magic" field. > From vlad_dumitrescu@REDACTED Wed Jun 15 22:05:35 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 15 Jun 2005 22:05:35 +0200 Subject: JInterface question References: <1CA2B2EC-3EA4-4894-8791-8A383CA2F587@gmail.com> Message-ID: Hi, If your application permits, you could also send the binary as-is (without any base64 encoding) and do the encoding where and when it is needed. Or handle the encoded binary as a regular binary, send it and decode it on the Erlang side. If you send "normal" Erlang objects, you don't need to use OtpOutputStream at all, it is handled behind the scenes by for example OtpMBox.send/receive. > From the OtpOutputStream class documentation : > Provides a stream for encoding Erlang terms to external format, for > transmission or storage. Yes, for storage, you don't need any magic header, for transmission you do. regards, Vlad From per@REDACTED Thu Jun 16 09:50:18 2005 From: per@REDACTED (Per Bergqvist) Date: Thu, 16 Jun 2005 09:50:18 +0200 Subject: Erlounge Moscow Message-ID: <20050616074625.M9666@synap.se> Hi, will spend the weekend in Moscow. Think that this is an excellent opportunity to expand the Erlounge coverage map ;-) Are there any other Erlangers in the Moscow area up for a beer or five ? BR Per From sanjaya@REDACTED Thu Jun 16 10:29:39 2005 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Thu, 16 Jun 2005 14:29:39 +0600 Subject: auth init check failed: noSuchView Message-ID: <019201c5724d$89b47340$6900a8c0@wavenet.lk> are you familier with this ..? Need some Assistance ... Already I Erlang SNMP done the get,get_next for tables & it works properly .... but when I try to "SET" some thing ....even ... in variable it gives the error ** SNMP MASTER-AGENT LOG: auth init check failed: noSuchView (in agent's side ....) Sanjaya From thomasl_erlang@REDACTED Thu Jun 16 12:14:23 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 16 Jun 2005 03:14:23 -0700 (PDT) Subject: Getting concurrency In-Reply-To: <42B07207.2020508@hyber.org> Message-ID: <20050616101423.28200.qmail@web41904.mail.yahoo.com> --- Claes Wikstrom wrote: > As for speed, I remember that I worked a lot with > various ways > to let lookup() return a pointer instead of copying > the whole thing. > I couldn't ever get it to work well though. This would be a nice, possibly very nice, feature when you have a shared heap system, but last I asked, it wasn't done. (Hint hint, Uppsala :-) Without a shared heap, pointers out of the private heap would have to be detected and managed by the GC. Hipe once upon a time shared constant terms outside the normal heap, and possibly still does. If so, that could be another path to getting rid of ets copying (at least the copy out of the table). Best, Thomas __________________________________ Discover Yahoo! Get on-the-go sports scores, stock quotes, news and more. Check it out! http://discover.yahoo.com/mobile.html From thomasl_erlang@REDACTED Thu Jun 16 12:17:43 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 16 Jun 2005 03:17:43 -0700 (PDT) Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: Message-ID: <20050616101743.11991.qmail@web41901.mail.yahoo.com> --- Vlad Dumitrescu wrote: > In-between I see another way, that I like most: let > the framework be hidden > behind the regular bifs, making the whole mechanism > completely transparent. > Then all applications could use it. Since it's > integrated in the vm, it > could do things better than an Erlang-only solution. Sounds sensible -- that's the way I would start too. You can probably write a good part of this in Erlang too, as a library or a framework. Then drop down to C as the situation demands. Best, Thomas __________________________________ Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html From vlad.xx.dumitrescu@REDACTED Thu Jun 16 12:37:15 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Thu, 16 Jun 2005 12:37:15 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE588@esealmw105.eemea.ericsson.se> From: Thomas Lindgren >--- Vlad Dumitrescu >wrote: >> In-between I see another way, that I like most: let >> the framework be hidden >> behind the regular bifs, making the whole mechanism >> completely transparent. >> Then all applications could use it. Since it's >> integrated in the vm, it >> could do things better than an Erlang-only solution. > >Sounds sensible -- that's the way I would start too. >You can probably write a good part of this in Erlang >too, as a library or a framework. Then drop down to C >as the situation demands. Yes, it can be done in Erlang as a proof of concept (it is the "framework" solution). But since bifs are affected, an Erlang-only solution can't be transparent. There might also be distribution details not accesible from Erlang (just a supposition). Earlier I said: > - a spawn bif that does load balancing behind the scenes > (but looks >like a local spawn) > - a way to let the node cluster look as just one node to > the outside (including the global registration service), but > still be able to identify each other. After some more thinking, the second part seems trickier than I first thought. With the current distribution mechanism, the only possible setup is to have a master node that gets registered and is visible from outside, and some slave hidden nodes (as was pointed out earlier). This however means that all traffic to the outside will have to go through the master node, possibly making it a bottleneck. Also, what if it crashes? (it happens sometimes :-) Also, the slave nodes must be aware of their situation and for example return the master's name when asked for their name. This is only important with Erlang-intensive traffic, sockets should work without any trouble. regards, Vlad From serge@REDACTED Thu Jun 16 12:44:57 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 16 Jun 2005 06:44:57 -0400 Subject: auth init check failed: noSuchView In-Reply-To: <019201c5724d$89b47340$6900a8c0@wavenet.lk> References: <019201c5724d$89b47340$6900a8c0@wavenet.lk> Message-ID: <42B15829.3010208@hq.idt.net> Try to add the following to your vacm.conf: {vacmSecurityToGroup, v1, "all-rights", "all-rights"}. {vacmSecurityToGroup, v2c, "all-rights", "all-rights"}. {vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}. {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}. and also add this to your community.conf: {"2", "all-rights", "all-rights", "", ""}. % | % +-- This is just some unique ID When done, start the SNMP agent, and try to do a SET command from a manager using "all-rights" as the community name. Serge Sanjaya Vitharana wrote: > are you familier with this ..? > > Need some Assistance ... > > Already I Erlang SNMP done the get,get_next for tables & it works properly > .... > > but when I try to "SET" some thing ....even ... in variable it gives the > error > > ** SNMP MASTER-AGENT LOG: > auth init check failed: noSuchView (in agent's side ....) > > Sanjaya From mickael.remond@REDACTED Thu Jun 16 13:51:36 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 16 Jun 2005 13:51:36 +0200 Subject: jabberlang In-Reply-To: <00b601c55ada$1f7ca540$7339fea9@ituniv237> References: <00b601c55ada$1f7ca540$7339fea9@ituniv237> Message-ID: <42B167C8.1050709@erlang-fr.org> Simon Aurell wrote: > It's a good library and I really hope Micka?l finds the time to finish it. I > believe a lot of people are eagerly awaiting it... including myself :) Hello, I finally took some time to publish the Jabberlang library. I have release it as is. I am still planning to complete the Jabber/XMPP protocol support. See: http://www.erlang-projects.org/Public/projects/libraries/jabberlang_0.1/view and, for download: http://downloads.erlang-projects.org/contribs/jabberlang-0.1.tar.gz Feedback, ideas or contributions will be of course warmly welcomed. I hope this helps, -- Micka?l R?mond From klacke@REDACTED Thu Jun 16 14:35:58 2005 From: klacke@REDACTED (Claes Wikstrom) Date: Thu, 16 Jun 2005 14:35:58 +0200 Subject: security upgrade for Yaws Message-ID: <42B1722E.9040105@hyber.org> A security bug was found in Yaws by SEC-Consult Unternehmensberatung GmbH while they were doing security assements on the Nortel SSL-VPN produkt: vulnerabilty overview: --------------- If a null byte is appended to the filename of a yaws script (.yaws), the yaws webserver returns a page containing the source code of the according script. This flaw allows a malicious attacker to analyse the source code of the entire web application, which might result in the attacker gaining sensitiv information like passwords. A new release (1.56) as well as a patch is available at http://yaws.hyber.org /klacke From aruna.jambunathan@REDACTED Thu Jun 16 15:08:34 2005 From: aruna.jambunathan@REDACTED (aruna.jambunathan@REDACTED) Date: Thu, 16 Jun 2005 18:38:34 +0530 Subject: error in gs:start() Message-ID: <7BCD17BB75C4464D866EB5A20D5E889E4F9003@HYD-MKD-MBX01.wipro.com> Hi all, I am getting the following error after installing erlang R9C2. erl Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] Eshell V5.3.6.3 (abort with ^G) 1> I=gs:start(). {error,backend_died} Can anyone suggest whats wrong. Regards, Aruna Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@REDACTED immediately and destroy all copies of this message and any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hakan.stenholm@REDACTED Thu Jun 16 16:20:42 2005 From: hakan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Thu, 16 Jun 2005 16:20:42 +0200 Subject: error in gs:start() In-Reply-To: <7BCD17BB75C4464D866EB5A20D5E889E4F9003@HYD-MKD-MBX01.wipro.com> References: <7BCD17BB75C4464D866EB5A20D5E889E4F9003@HYD-MKD-MBX01.wipro.com> Message-ID: <42B18ABA.7040202@mbox304.swipnet.se> aruna.jambunathan@REDACTED wrote: > Hi all, > > I am getting the following error after installing erlang R9C2. > > > > erl > > Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] > > > > Eshell V5.3.6.3 (abort with ^G) > > 1> I=gs:start(). > > {error,backend_died} > You'll need to have tcl/tk (or at least tk) installed for gs to work - tk is the gs backend. If tcl/tk is allready installed and gs doesn't work - it is probably likely that the tk version is to old and you'll need to install a newer version (I've had this issue with MacOSX). > > > > > Can anyone suggest whats wrong. > > > > Regards, > > Aruna > > > > > > > > > > > > Confidentiality Notice > > The information contained in this electronic message and any > attachments to this message are intended > for the exclusive use of the addressee(s) and may contain confidential > or privileged information. If > you are not the intended recipient, please notify the sender at Wipro > or Mailadmin@REDACTED immediately > and destroy all copies of this message and any attachments. > From erlang@REDACTED Thu Jun 16 17:24:35 2005 From: erlang@REDACTED (Michael McDaniel) Date: Thu, 16 Jun 2005 08:24:35 -0700 Subject: security upgrade for Yaws In-Reply-To: <42B1722E.9040105@hyber.org> References: <42B1722E.9040105@hyber.org> Message-ID: <20050616152435.GT25822@fangora.autosys.us> Thanks for your quick response. (And thanks to SEC-Consult) ~Michael On Thu, Jun 16, 2005 at 02:35:58PM +0200, Claes Wikstrom wrote: > > > A security bug was found in Yaws by SEC-Consult Unternehmensberatung > GmbH while they were doing security assements on the Nortel SSL-VPN produkt: > > > > > > vulnerabilty overview: > --------------- > > If a null byte is appended to the filename of a yaws script (.yaws), the > yaws webserver returns a page containing the source code of the > according script. This flaw allows a malicious attacker to analyse the > source code of the entire web application, which might result in the > attacker gaining sensitiv information like passwords. > > > > A new release (1.56) as well as a patch is available at > http://yaws.hyber.org > > > /klacke From mickael.remond@REDACTED Thu Jun 16 17:49:45 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 16 Jun 2005 10:49:45 -0500 (CDT) Subject: Mnesia question Message-ID: <23967.194.2.91.222.1118936985.fusewebmail-66260@webmail.fusemail.com> Hello, I have encountered potentially strange behaviour with Mnesia, when the changes applied to the database where made in a script-like fashion in a short-lived program. I had a program that was starting the database, then was inserting a record in the database and last was stopping mnesia and the Erlang VM with init:stop(). My record where not found in the database after a restart of the VM and Mnesia. It where correctly written by my script however (I put a read and print instruction to check). I found that the record was in the log file in the database directory, but was not replayed by Mnesia when restarted. I thought that it might have to do with log threshold options (Dump log is not triggered as the size of the transaction or the max time before dump is not reached). Finally adding a mnesia:dump_log instruction before stopping Mnesia in my short lived script solve the problem. I was wondering if this was the expected behaviour. I would have guessed that Mnesia should have read the log on startup or that shutdown would have dump the log. I was using Erlang/OTP R10B-3. Thank you for your feedback -- Micka?l R?mond From peter@REDACTED Thu Jun 16 18:32:27 2005 From: peter@REDACTED (Peter H|gfeldt) Date: Thu, 16 Jun 2005 18:32:27 +0200 (MEST) Subject: Yaws + SSL in non Win32 OS In-Reply-To: <20050607102914.GA5415@hyber.org> Message-ID: I didn't realise the importance of this patch. It will be included in a bauta-patch to our paying customers, and in the opensource release in the beginning of next week. /Peter On Tue, 7 Jun 2005 klacke@REDACTED wrote: > On Mon, Jun 06, 2005 at 04:23:40PM -0300, Inswitch Solutions wrote: > > Hi Klacke, > > > > I can't find the patch you mention, please could you give the URL to > > download it? > > > > > > > > --- esock.c~ 2004-09-14 14:02:44.000000000 +0200 > +++ esock.c 2005-04-07 11:25:43.068624336 +0200 > @@ -138,7 +138,7 @@ > #define MAJOR_VERSION 2 > #define MINOR_VERSION 0 > #define MAXREPLYBUF 256 > -#define RWBUFLEN 4096 > +#define RWBUFLEN (32*1024) > #define IS_CLIENT 0 > #define IS_SERVER 1 > #define SELECT_TIMEOUT 2 /* seconds */ > > > > > /klacke > > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > From serge@REDACTED Thu Jun 16 18:36:59 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 16 Jun 2005 12:36:59 -0400 Subject: snmp release build Message-ID: <42B1AAAB.7020901@hq.idt.net> Hi, When I include an SNMP applicaiton in a release under R10B-5, I am getting a bunch of compilation warnings: proxy.rel: {release, {"proxy","1.0"}, {erts, "100.100.100"}, [{kernel,"2.10.7"}, {stdlib,"1.13.7"}, {snmp, "4.1.4"}, {proxy, "1.0"}]}. >erlc -pa ../ebin -o ../ebin -d proxy.rel *WARNING* snmp: Source code not found: snmp.erl *WARNING* snmp: Source code not found: snmp_app.erl *WARNING* snmp: Source code not found: snmp_app_sup.erl *WARNING* snmp: Source code not found: snmpa.erl *WARNING* snmp: Source code not found: snmpa_acm.erl *WARNING* snmp: Source code not found: snmpa_agent.erl *WARNING* snmp: Source code not found: snmpa_agent_sup.erl *WARNING* snmp: Source code not found: snmpa_app.erl *WARNING* snmp: Source code not found: snmpa_authentication_service.erl *WARNING* snmp: Source code not found: snmpa_error.erl *WARNING* snmp: Source code not found: snmpa_error_io.erl *WARNING* snmp: Source code not found: snmpa_error_logger.erl *WARNING* snmp: Source code not found: snmpa_error_report.erl *WARNING* snmp: Source code not found: snmpa_general_db.erl ... I traced this to the systools_make:make_script() that cannot guess the location of SNMP's source files because they haven't been stored using conventional directories: >ls -al /usr/local/lib/erlang/lib/snmp-4.1.4/src total 28 drwxr-xr-x 7 root root 4096 Jun 15 16:10 . drwxr-xr-x 9 serge devlp 4096 Jun 15 16:10 .. drwxr-xr-x 2 root root 4096 Jun 15 16:10 agent drwxr-xr-x 2 root root 4096 Jun 15 16:10 app drwxr-xr-x 2 root root 4096 Jun 15 16:10 compiler drwxr-xr-x 2 root root 4096 Jun 15 16:10 manager drwxr-xr-x 2 root root 4096 Jun 15 16:10 misc I think it can be considered a bug in the SNMP. I don't see a good way of hiding these warning messages ("+silent" option given to erlc doesn't quite help). Serge From erlang@REDACTED Thu Jun 16 20:17:48 2005 From: erlang@REDACTED (Inswitch Solutions) Date: Thu, 16 Jun 2005 15:17:48 -0300 Subject: Yaws + SSL in non Win32 OS References: Message-ID: <00d001c5729f$d8cbf960$4a00a8c0@Inswitch251> Hi Peter, I've three more patches which I've been asking about to Ericsson support, but without any feedback from them. The following happens on Win32 + Yaws web server with latest patches and SSL enabled + otp_LXA_11930_win32_R10B.exe (licensed) : 1) FD requests growing and never been released from the FD set (memory consumed). static void close_and_remove_connection(Connection *cp) { + FD_CLR(cp->fd, &readmask); // release read FD + FD_CLR(cp->fd, &writemask); // release write FD + FD_CLR(cp->fd, &exceptmask); // release exceptions FD safe_close(cp->fd); remove_connection(cp); } 2) When a client disconnects the read function fails with SSL_ERROR_SYSCALL and the port starts looping endlessly over the same internal state (CPU 100%). Try OpenSSL "s_client -connect localhost:443 -prexit" with a local Yaws web server and then exit from the console opened and also happens when browsing web pages. I have modified line 1077 of esock.c with: + } else { //if (cc == 0) { 3) Form upload for more than 120kb fails (http://yaws.hyber.org/upload0.yaws used) I have increased + #define RWBUFLEN (120*1024) This is the only way I've found to solve the above issues and I'd like to share this knowledge with the Erlang list. May be there are some other approaches. regards, Eduardo Figoli Prepaid Expertise - Programmable Switches Powered by Ericsson Licensed Technology Eng. Eduardo Figoli - Development Center - IN Switch Solutions Inc. Headquarters - Miami-U.S.A. Tel: 1305-3578076 Fax: 1305-7686260 Development Center - Montevideo - Uruguay Tel/Fax: 5982-7104457 e-mail: eduardo@REDACTED ----- Original Message ----- From: "Peter H|gfeldt" To: Cc: Sent: Thursday, June 16, 2005 1:32 PM Subject: Re: Yaws + SSL in non Win32 OS > > I didn't realise the importance of this patch. It will be included > in a bauta-patch to our paying customers, and in the opensource > release in the beginning of next week. > > /Peter > > On Tue, 7 Jun 2005 klacke@REDACTED wrote: > > > On Mon, Jun 06, 2005 at 04:23:40PM -0300, Inswitch Solutions wrote: > > > Hi Klacke, > > > > > > I can't find the patch you mention, please could you give the URL to > > > download it? > > > > > > > > > > > > > > > --- esock.c~ 2004-09-14 14:02:44.000000000 +0200 > > +++ esock.c 2005-04-07 11:25:43.068624336 +0200 > > @@ -138,7 +138,7 @@ > > #define MAJOR_VERSION 2 > > #define MINOR_VERSION 0 > > #define MAXREPLYBUF 256 > > -#define RWBUFLEN 4096 > > +#define RWBUFLEN (32*1024) > > #define IS_CLIENT 0 > > #define IS_SERVER 1 > > #define SELECT_TIMEOUT 2 /* seconds */ > > > > > > > > > > /klacke > > > > > > -- > > Claes Wikstrom -- Caps lock is nowhere and > > http://www.hyber.org -- everything is under control > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1429 bytes Desc: not available URL: From aruna.jambunathan@REDACTED Fri Jun 17 07:15:10 2005 From: aruna.jambunathan@REDACTED (aruna.jambunathan@REDACTED) Date: Fri, 17 Jun 2005 10:45:10 +0530 Subject: error in gs:start() Message-ID: <7BCD17BB75C4464D866EB5A20D5E889E4F910F@HYD-MKD-MBX01.wipro.com> Can tk/tcl be obtained for solaris platform too. This error is basically in solaris 5.8 -----Original Message----- From: H?kan Stenholm [mailto:hakan.stenholm@REDACTED] Sent: Thursday, June 16, 2005 7:51 PM To: Aruna Jambunathan(WT01 - TELECOM SOLUTIONS) Cc: erlang-questions@REDACTED Subject: Re: error in gs:start() aruna.jambunathan@REDACTED wrote: > Hi all, > > I am getting the following error after installing erlang R9C2. > > > > erl > > Erlang (BEAM) emulator version 5.3.6.3 [source] [hipe] > > > > Eshell V5.3.6.3 (abort with ^G) > > 1> I=gs:start(). > > {error,backend_died} > You'll need to have tcl/tk (or at least tk) installed for gs to work - tk is the gs backend. If tcl/tk is allready installed and gs doesn't work - it is probably likely that the tk version is to old and you'll need to install a newer version (I've had this issue with MacOSX). > > > > > Can anyone suggest whats wrong. > > > > Regards, > > Aruna > > > > > > > > > > > > Confidentiality Notice > > The information contained in this electronic message and any > attachments to this message are intended > for the exclusive use of the addressee(s) and may contain confidential > or privileged information. If > you are not the intended recipient, please notify the sender at Wipro > or Mailadmin@REDACTED immediately > and destroy all copies of this message and any attachments. > Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@REDACTED immediately and destroy all copies of this message and any attachments. From dgud@REDACTED Fri Jun 17 07:48:42 2005 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 17 Jun 2005 07:48:42 +0200 Subject: Mnesia question In-Reply-To: <23967.194.2.91.222.1118936985.fusewebmail-66260@webmail.fusemail.com> References: <23967.194.2.91.222.1118936985.fusewebmail-66260@webmail.fusemail.com> Message-ID: <17074.25658.264015.490063@rian.du.uab.ericsson.se> Hi That doesn't sound good, can you email me your test, and I'll have a look at it. /Dan Mickael Remond writes: > Hello, > > I have encountered potentially strange behaviour with Mnesia, when the > changes applied to the database where made in a script-like fashion in a > short-lived program. > > I had a program that was starting the database, then was inserting a > record in the database and last was stopping mnesia and the Erlang VM with > init:stop(). > > My record where not found in the database after a restart of the VM and > Mnesia. It where correctly written by my script however (I put a read and > print instruction to check). > > I found that the record was in the log file in the database directory, but > was not replayed by Mnesia when restarted. > I thought that it might have to do with log threshold options (Dump log is > not triggered as the size of the transaction or the max time before dump > is not reached). > > Finally adding a mnesia:dump_log instruction before stopping Mnesia in my > short lived script solve the problem. > > I was wondering if this was the expected behaviour. I would have guessed > that Mnesia should have read the log on startup or that shutdown would > have dump the log. > > I was using Erlang/OTP R10B-3. > > Thank you for your feedback > > -- > Micka?l R?mond From joe.armstrong@REDACTED Fri Jun 17 09:38:37 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Fri, 17 Jun 2005 09:38:37 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of Vlad Dumitrescu > Sent: den 15 juni 2005 20:33 > To: erlang-questions@REDACTED > Subject: Re: Getting locks and sharing: was RE: Getting concurrency > > > From: "Vance Shipley" > > I'm not sure what to do after that. Do you make the "extra" nodes > > hidden and try and load share behind the scenes or do you just leave > > it at that and expect people to use normal erlang distribution? > > Hi, > > My two cents on this, very sketchy. > > The most complex way is to make the mulator multi-CPU aware, > with all the > hassle involved. Just the distributed garbage collection > could probably > support a couple of Ph.D. theses. On the plus side, load balancing is > automatic. > We shouldn't do this :-) > The simplest way is to just strt several nodes, let them know > about each > other and leave it to the application developers to take > advantage of the > fact. Yes > In order for this to be useful, some kind of framework > is needed to > handle the housekeeping, like load balancing and a new global process > registration. Applications must be multi-CPU aware, in order > to use it. Is this right? - I think not. IMHO the single most important design "boundary" is the inter-processor boundary. Today there are 3 different RPC's: RPC1 - between two processes in the same Erlang node RPC2 - between two processes in different nodes in a single CPU RPC3 - between two processes in different nodes on different CPU's The times for these are *vastly* different RPC1 is in microseconds, RPC3 is in millisceconds. When we have multi-core CPUs well have: RPC4 - between two processes in different nodes in different CPUs on the same chip Will RPC4 behave like RPC2? nobody knows. As regards fault-tolerance we also get a number of different failure properties depending upon where the processes are located. My view is that the programmer should know about these boundaries and design their application with respect to the boundaries - we should not abstract away from the location of the processes. Now there *is* a case for library support for allocating processes etc onto nodes *after* this design has been performed - IF the design leads to the conclusion that process location is unimportant THEN we can use libraries that allocate processes depending upon load etc. In any case the layers must be *very* clear and the consequences of using a library must be clear to the programmer. > In-between I see another way, that I like most: let the > framework be hidden > behind the regular bifs, making the whole mechanism > completely transparent. > Then all applications could use it. Since it's integrated in > the vm, it > could do things better than an Erlang-only solution. > > What I think is needed at the most basic level is: > - a spawn bif that does load balancing behind the scenes > (but looks like > a local spawn) > - a way to let the node cluster look as just one node to > the outside > (including the global registration service), but still be > able to identify > each other. > > And I think it should be enough to get started... There's > plenty of useful > things to add later. > > What do you think? I think we should "just" make OTP/Erlang run on single nodes (and on single CPU's in a multi-CPU chip) << and I expect even "just" to be difficult :-) >> Then we should add a few new bifs that are "multi-CPU aware". Then we should write some OTP behaviours to abstract the multi-CPU properties. /Joe > regards, > Vlad > From vlad.xx.dumitrescu@REDACTED Fri Jun 17 10:05:51 2005 From: vlad.xx.dumitrescu@REDACTED (Vlad Dumitrescu XX (LN/EAB)) Date: Fri, 17 Jun 2005 10:05:51 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: <11498CB7D3FCB54897058DE63BE3897C4BE58B@esealmw105.eemea.ericsson.se> Hi Joe, The point about RPC times is very important, yes. I would be very surprised if the times for RPC4 will be different than for RPC2 - at least when the multi-core CPU design matures. But you are right not to rely on that. One could also consider using a different distribution bearer for such multi-core clusters of nodes, maybe using shared memory instead of TCP/IP. Hopefully that could provide better times. >In any case the layers must be *very* clear and the consequences of > using a library must be clear to the programmer. True, I didn't think about that. Was looking from the other end, about not having to change old code to be able to take advantage of the multiple CPUs. >Then we should add a few new bifs that are "multi-CPU aware". >Then we should write some OTP behaviours to abstract the multi-CPU >properties. Well, that's a supporting framework, if anything :-) regards, Vlad From peter@REDACTED Fri Jun 17 15:29:39 2005 From: peter@REDACTED (Peter H|gfeldt) Date: Fri, 17 Jun 2005 15:29:39 +0200 (MEST) Subject: erlang-questions-posters Message-ID: Dear erlang-questions subscriber, If you do not want to get mail from the erlang-questions list (e.g. if you read the list by other means), but still want to be able to make contributions to the list, you can unsubscribe to the erlang-questions list, and subscribe to the erlang-questions-posters list. Regards, Peter (Majordomo) From ingela@REDACTED Sat Jun 18 15:10:43 2005 From: ingela@REDACTED (Ingela Anderton) Date: Sat, 18 Jun 2005 15:10:43 +0200 Subject: inets http client url escaping References: <200506111647.20669.will@misconception.org.uk> <17071.56020.147245.283392@gargle.gargle.HOWL> <200506151154.01821.will@misconception.org.uk> Message-ID: <17076.7507.500923.471904@gargle.gargle.HOWL> Will Newton wrote: > On Wednesday 15 June 2005 08:37, Ingela Anderton wrote: > > > > Is there a way to hex encode non 7-bit ASCII values in a path or query? I > > > haven't found a canonical source on what the correct way to do this, RFC > > > 2396 seems to leave it open, but I would expect to be able to do that. > > > > I do not know if it is the expected behavior! > > The uri-parsing is the one part of the http-client that > > has not at all been changed from the "prototype" (unsported version) > > that was contributed by Johan Blom. We will have to look into that. > > Thanks. Does Erlang have a publically available issue tracker where issues > like this one could be monitored? Issue tracker well yes, a public one I am afraid not. It is not an option to make our current system public. In the long run we are thinking about changing our system and you never know..., but I do not want to get your hopes up too much nothing has as yet been decide, and even then the switching process might take awhile! -- /Ingela - OTP team From sean.hinde@REDACTED Sat Jun 18 15:31:50 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Sat, 18 Jun 2005 14:31:50 +0100 Subject: inets http client url escaping In-Reply-To: <17076.7507.500923.471904@gargle.gargle.HOWL> References: <200506111647.20669.will@misconception.org.uk> <17071.56020.147245.283392@gargle.gargle.HOWL> <200506151154.01821.will@misconception.org.uk> <17076.7507.500923.471904@gargle.gargle.HOWL> Message-ID: On 18 Jun 2005, at 14:10, Ingela Anderton wrote: > Will Newton wrote: > >> On Wednesday 15 June 2005 08:37, Ingela Anderton wrote: >> >> >>>> Is there a way to hex encode non 7-bit ASCII values in a path or >>>> query? I >>>> haven't found a canonical source on what the correct way to do >>>> this, RFC >>>> 2396 seems to leave it open, but I would expect to be able to do >>>> that. >>>> >>> >>> I do not know if it is the expected behavior! >>> The uri-parsing is the one part of the http-client that >>> has not at all been changed from the "prototype" (unsported version) >>> that was contributed by Johan Blom. We will have to look into that. >>> >> >> Thanks. Does Erlang have a publically available issue tracker >> where issues >> like this one could be monitored? >> > Issue tracker well yes, a public one I am afraid not. > It is not an option to make our current system public. > In the long run we are thinking about changing our system and you > never know..., but I do not want to get your hopes up too much nothing > has as yet been decide, and even then the switching process might take > awhile! In the meantime there are two mailing lists - erlang-bugs@REDACTED, and erlang-patches@REDACTED I would hope that someone from the OTP team reads them occasionally :) Sean From ulf@REDACTED Sun Jun 19 01:13:18 2005 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 19 Jun 2005 01:13:18 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: Den 2005-06-17 09:38:37 skrev Joe Armstrong (AL/EAB) : >> The most complex way is to make the mulator multi-CPU aware, >> with all the hassle involved. Just the distributed garbage >> collection could probably support a couple of Ph.D. theses. >> On the plus side, load balancing is automatic. >> > > We shouldn't do this :-) I disagree. > IMHO the single most important design "boundary" is theinter-processor > boundary. Today there are 3 different RPC's: Which, disregarding microseconds, are semantically different. > RPC1 - between two processes in the same Erlang node Here, we are 'guaranteed' that messages cannot be dropped. > RPC2 - between two processes in different nodes in a single CPU Here, it is actually possible that communication may be lost (e.g. due to overload and supervision timeout on the link. > RPC3 - between two processes in different nodes on different CPU's Like RPC2, but the possible failure modes increase, and the CPUs are not coupled by a common operating system as they are in RPC2 (where there might only be one CPU) > > The times for these are *vastly* different RPC1 is in microseconds, > RPC3 is in millisceconds. Not quite. You should be able to get round-trip delays around 100 us on an RPC with fast boxes and a fast network. With network technology like SCI or VIA, it should be possible with round-trips under 100 us. It's still vastly different from RPC1 (around a factor 5-10x), but usually more significant is the difference in failure modes. > When we have multi-core CPUs well have: > > RPC4 - between two processes in different nodes in different > CPUs on the same chip > > Will RPC4 behave like RPC2? nobody knows. Semantically no, but the most dramatic difference is one that should be accounted for always: suddenly with 2 CPUs, you can have true concurrency. > > As regards fault-tolerance we also get a number of different > failure properties depending upon where the processes are located. Indeed. > My view is that the programmer should know about these boundaries > and design their application with respect to the boundaries - we > should not abstract away from the location of the processes. I am convinced (as I'm sure you are too) that one should _never_ write code based on the assumption that the nature of the current reduction counting scheduler and the single-CPU architecture somehow guarantees serialization and mutual exclusion up to a point. Subtle changes to the code, or changes in the implementation of the scheduler, might trigger latent timing bugs. One should always design as if the scheduler offers true concurrency. Assuming this, using multiple CPUs within a single node should not change any vital semantics or failure modes. And it is not obvious that the cost of message passing within the node will be drastically more expensive. IMHO, introducing shared or hybrid heap would have a much more profound effect on message passing cost (i.e. going from proportional to the message size to being constant) I'm not against introducing ways to explicitly control load balancing and co-location, I think, but I think the default mode should be that the erlang runtime system takes advantage of multiple CPUs, if they're there. This should be transparent to the program. /Uffe From roger.larsson@REDACTED Sun Jun 19 03:07:05 2005 From: roger.larsson@REDACTED (Roger Larsson) Date: Sun, 19 Jun 2005 03:07:05 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <200506190307.05494.roger.larsson@norran.net> What about serialising data sent "externally". Isn't all data sent between nodes serialised? (for architecture and release independence) Or does Erlang optimise the case where both nodes are equivalent? On Friday 17 June 2005 09.38, Joe Armstrong (AL/EAB) wrote: > IMHO the single most important design "boundary" is the inter-processor > boundary. Today there are 3 different RPC's: > > RPC1 - between two processes in the same Erlang node same node => same processor and Erlang release > RPC2 - between two processes in different nodes in a single CPU different nodes => could be different Erlang releases, especially if used during upgrades of the run time environment. > RPC3 - between two processes in different nodes on different CPU's different nodes & different CPUs => probably different Erlang releases too > > The times for these are *vastly* different RPC1 is in microseconds, RPC3 is > in millisceconds. > > When we have multi-core CPUs well have: > > RPC4 - between two processes in different nodes in different CPUs on the > same chip The system architect should be able to choose if he like to use * two nodes for separation * single node for less communication overhead (no serialisation required) * why not native OS threads (one per process) [yes I know, but there might be some application that benefit] * something like Erlang process groups - group which Erlang processes runs better with same processor or data available. * a mix of all possibilities above! [First select what needs to be protected from each other, Then assume "unlimited" no of processors - OK, possible? (no dynamic process creation) or why not a limited but big no of processors - which processes SHOULD run together, for optimum performance? BTW there are even mixed-core chips: RPC5 - two nodes with different CPU's on one chip (using shared memory) for communication. Examples: The Cell Texas Instruments: ARM+DSP /RogerL From ke.han@REDACTED Sun Jun 19 06:24:22 2005 From: ke.han@REDACTED (ke.han) Date: Sun, 19 Jun 2005 12:24:22 +0800 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <42B4F376.3080403@redstarling.com> > > IMHO the single most important design "boundary" is the inter-processor > boundary. Today there are 3 different RPC's: > > RPC1 - between two processes in the same Erlang node > RPC2 - between two processes in different nodes in a single CPU > RPC3 - between two processes in different nodes on different CPU's > > The times for these are *vastly* different RPC1 is in microseconds, RPC3 is in millisceconds. > > When we have multi-core CPUs well have: > > RPC4 - between two processes in different nodes in different CPUs on the same chip So would RPC5 be: RPC5 between two processes in the same node in different CPUs on the same chip What you describe as RPC4 seems to be a niche requirement. What I'm calling RPC5 seems much more needed. thanks, ke han From meena_selvam@REDACTED Sun Jun 19 08:41:04 2005 From: meena_selvam@REDACTED (MEENA SELVAM) Date: Sat, 18 Jun 2005 23:41:04 -0700 (PDT) Subject: doubt on fun In-Reply-To: <42B4F376.3080403@redstarling.com> Message-ID: <20050619064104.9856.qmail@web30415.mail.mud.yahoo.com> Can anyone explain what happens when we use something like this? function1()-> my_fun( param1, fun({p1,p2})-> p3 = function2(p1,p2) end ). where p1, and p2 are some variables whose scope includes within this function. My doubt is what happens, when we put the fun as a parameter to a function. Since the fun is in the body, will the statements within the fun end block be executed just like any other expression? Similarly, what happens when fun... end is used as part of map as follows? map(fun(X)-> {Y,Z} end, somelist) In comparison with map(Func, List) applying Func to each element in the list, what does the above map with func .... end applies to the list? I am not clear on this, but I am reading code, of these kinds. meena --- "ke.han" wrote: > > > > > IMHO the single most important design "boundary" > is the inter-processor > > boundary. Today there are 3 different RPC's: > > > > RPC1 - between two processes in the same > Erlang node > > RPC2 - between two processes in different > nodes in a single CPU > > RPC3 - between two processes in different > nodes on different CPU's > > > > The times for these are *vastly* different RPC1 > is in microseconds, > RPC3 is in millisceconds. > > > > When we have multi-core CPUs well have: > > > > RPC4 - between two processes in different > nodes in different CPUs > on the same chip > > > So would RPC5 be: > RPC5 between two processes in the same node in > different CPUs on > the same chip > > What you describe as RPC4 seems to be a niche > requirement. What I'm > calling RPC5 seems much more needed. > > > thanks, ke han > ____________________________________________________ Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com From csanto@REDACTED Sun Jun 19 10:08:19 2005 From: csanto@REDACTED (Corrado Santoro) Date: Sun, 19 Jun 2005 10:08:19 +0200 Subject: doubt on fun In-Reply-To: <20050619064104.9856.qmail@web30415.mail.mud.yahoo.com> References: <20050619064104.9856.qmail@web30415.mail.mud.yahoo.com> Message-ID: <42B527F3.9070703@diit.unict.it> MEENA SELVAM wrote: > My doubt is what happens, when we put the fun as a > parameter to a function. Since the fun is in the body, > will the statements within the fun end block be > executed just like any other expression? No, the fun/end block is executed when the function is evaluated. I mean: F = fun(X) -> X + 1 end. This statement assigns to "F" the code of the fun. It is a simple assignment, not a "fun" execution. When you write: F(100) you'll really execute the fun you declared above and get the result, "101" in this case. When you pass a fun as a function parameter, a similar thing happens. The fun is assigned to an internal variable of the function and then it performs invocation, when needed. > Similarly, what happens when fun... end is used as > part of map as follows? > > map(fun(X)-> > {Y,Z} > end, > somelist) > > In comparison with map(Func, List) applying Func to > each element in the list, what does the above map with > func .... end applies to the list? It applies the fun to each element of the list as well. However, in your example, Z has to be bound to a value. --Corrado -- ====================================================== Eng. Corrado Santoro, Ph.D. University of Catania - Engineering Faculty Department of Computer Science and Telecommunications Engineering Viale A. Doria, 6 - 95125 CATANIA (ITALY) Tel: +39 095 7382144 Int. (5) 8035 +39 095 7382380 +39 095 7382365 +39 095 7382364 VoIP: sip:8035@REDACTED Fax: +39 095 7382397 EMail: csanto@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.iit.unict.it ====================================================== From olivier.sambourg@REDACTED Sun Jun 19 23:34:56 2005 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Sun, 19 Jun 2005 23:34:56 +0200 Subject: JInterface question In-Reply-To: References: <1CA2B2EC-3EA4-4894-8791-8A383CA2F587@gmail.com> Message-ID: <976F9E38-6BCE-4E37-A3C7-BBC240D773D1@gmail.com> Hi I'm having another problem with erlang external format : an integer list in erlang is sometimes encoded as a string (when the integers all are in the 0..255 range). That is : binary_to_list(term_to_binary([1])). [131,107,0,1,1] When 107 is used to identify strings in the erlang external format (108 is for lists) : /** The tag used for strings and lists of small integers */ public static final int stringTag = 107; The problem is that the JInterface library tries to make an OtpErlangString out of the byte sequence and comes out with " " (with special characters in the string). I've found no way to convert it to an OtpErlangList. All I can do in this particular case is get the last n bytes of the stream and cast them as integers (where n is the size of the original list). For instance : binary_to_list(term_to_binary([1])). [131,107,0,1,1] -> last byte is 1 binary_to_list(term_to_binary([1,2,3,255])). [131,107,0,4,1,2,3,255] -> last 4 bytes are 1,2,3, 255 When one integer is out of the 0..255 range, the list is not treated as a string and everything is fine. Is there a cleaner way either on the server (erlang) or client (java) side ? I think I'll just add a dummy -1 integer to all the integer lists I want to transmit... Thanks a lot, -- Olivier PS : I guess this is an old one, but are we gonna see a separate string type in erlang someday ? No troll intended please, just a question ;) Le 15 juin 05 ? 22:05, Vlad Dumitrescu a ?crit : > Hi, > > If your application permits, you could also send the binary as-is > (without any base64 encoding) and do the encoding where and when it > is needed. Or handle the encoded binary as a regular binary, send > it and decode it on the Erlang side. > > If you send "normal" Erlang objects, you don't need to use > OtpOutputStream at all, it is handled behind the scenes by for > example OtpMBox.send/receive. > > > > >> From the OtpOutputStream class documentation : >> Provides a stream for encoding Erlang terms to external format, >> for transmission or storage. >> >> >> > > Yes, for storage, you don't need any magic header, for transmission > you do. > > regards, > Vlad > > > From ok@REDACTED Mon Jun 20 04:24:45 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 20 Jun 2005 14:24:45 +1200 (NZST) Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: <200506200224.j5K2Oj7m435134@atlas.otago.ac.nz> "Ulf Wiger" wrote: > RPC1 - between two processes in the same Erlang node Here, we are 'guaranteed' that messages cannot be dropped. Where is that promised? I can think of all sorts of reasons why RPC1 might be unreliable. I didn't like the idea at first, but then it dawned on me that if there are lots of messages being sent to a process which, though live, isn't bothering to listen (or is listening for the wrong thing), the mailbox will eventually take over all available memory to the detriment of other processes UNLESS at some point messages are discarded. To put it gnomically, the only way to achieve reliability is by means of unreliability. From ft@REDACTED Mon Jun 20 10:38:01 2005 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 20 Jun 2005 10:38:01 +0200 Subject: Fwd: bug in docs or in ets:info/1? Message-ID: <200506201038.01728.ft@it.su.se> Hi When googling for something unrelated, I stumbled upon an old post of mine that I did not remember ever getting an answer for, and the problem (if it is a problem) is still there in R10B-5, so I though I'd bring it up again. It seems really odd to me that ets:info/1 returns a tuple containing tuples instead of a list of tuples, like the documentation says it should. Is this a bug in the documentation or in the code? /Fredrik ---------- Forwarded Message ---------- Subject: bug in docs or in ets:info/1? Date: Tuesday 02 November 2004 07.35 From: Fredrik Thulin To: erlang-questions@REDACTED Hi It seems to me that the documentation of ets:info/1 isn't in sync with the code, or even more probably the other way around. The R10B-0 documentation says that ets:info/1 returns a list of tuples, when it is in fact returning a tuple containing a number of tuples. I think a list of tuples would be more suitable. Eshell V5.4 (abort with ^G) 1> L = ets:info(inet_cache). {{memory,277}, ... {protection,public}} 2> is_list(L). false 3> is_tuple(L). true 4> Documentation : >info(Tab) -> [{Item,Value}] | undefined > >Types: > >Tab = tid() | atom() >Item, Value - see below > >Returns information about the table Tab as a list of {Item,Value} >tuples: The fix in ets.erl seems pretty obvious, but maybe there are concerns with code that is expecting the current format? /Fredrik ------------------------------------------------------- From dietmar@REDACTED Mon Jun 20 10:53:05 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Mon, 20 Jun 2005 10:53:05 +0200 Subject: problem starting snmp Message-ID: <42B683F1.1080207@ast.dfs.de> Hi ! I have two nodes running a snmp agent. There is a dependency on which node has to be started first which I do not understand. If I start my agent on node a first everything seems ok. When I start the agent on node b first I get as the first message: ** Configuration error: failed starting mib-server: {'EXIT',{aborted,{no_exists,snmpa_mib_tree}}} ** SNMP MASTER-AGENT INFO: error starting mib server: {{error,{'EXIT',{aborted,{no_exists,snmpa_mib_tree}}}}, {child,undefined, {mib,#Ref<0.0.0.264>}, {snmpa_mib,start_link, [normal, ["/usr/local/otp_src_R10B-4/lib/erlang/lib/snmp-4.1.2/priv/mibs/STANDARD-MIB"], [{mib_storage,{mnesia,[]}}, {mibentry_override,true}, {trapentry_override,true}, {verbosity,info}]]}, transient, 10000, worker, [snmpa_mib]}} and a lot more .. Any hint ? regards Dietmar From serge@REDACTED Mon Jun 20 14:46:30 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 20 Jun 2005 08:46:30 -0400 Subject: More Q's about SNMP from Expert In-Reply-To: <014b01c57593$648c8460$6900a8c0@wavenet.lk> References: <019201c5724d$89b47340$6900a8c0@wavenet.lk> <42B15829.3010208@hq.idt.net> <024301c572f5$93645fb0$6900a8c0@wavenet.lk> <42B29FFF.9000302@hq.idt.net> <026401c57326$ac9d5230$6900a8c0@wavenet.lk> <42B2A775.5040905@hq.idt.net> <027801c57333$197b3b40$6900a8c0@wavenet.lk> <42B2BB88.40506@hq.idt.net> <02a301c57335$e69284b0$6900a8c0@wavenet.lk> <42B2C1C6.9050103@hq.idt.net> <02d001c5733c$59170500$6900a8c0@wavenet.lk> <42B2D695.3010009@hq.idt.net> <014b01c57593$648c8460$6900a8c0@wavenet.lk> Message-ID: <42B6BAA6.1040802@hq.idt.net> Sanjaya Vitharana wrote: > 1.) As your quick start guide, how to start "snmp trap daemon" in Windows ? > Are there any equalent to > > $ sudo snmptrapd -P -F "%02.2h:%02.2j TRAP%w.%q from %A\n %v\n%" -m > "snmp/agent/mibs/MY-TRAP-MIB.mib" As far as I recall NET-SNMP is not ported to Windows, and as a result, snmptrapd won't work under Win OS. However there are plenty of freeware tools available for Win that support traps - just google the net. > 2.) also why the "netstat" showing > UDP 0.0.0.0:4000 *:* ---- as my agent's port Because the agent didn't explicitely bind to any specific IP, it is listening to requests on *all* ips defined on the machine. > I have configured it to > {intAgentUDPPort, 4000}. > {intAgentIpAddress, [127,0,0,1]}. > > I think it should be better, if shown as UDP 127.0.0.1:4000 is it ? Can > you discribe why this happens ? If you saw 127.0.0.1:4000 in netstat that would mean that this listener would be able to accept requests only coming from that same localhost (127.0.0.1), and it wouldn't be visible from other computers. > 3.) further more my snmp client working as normal in my local mechine. > But when I try to connect to the same port using another mechine my port it > invisible ? > Are you familier with this? > What will be the reason? Firewall ?? What do you mean by the port being invisible? Clients from other hosts can't issue SNMP requests to this agent and receive a response? Serge > Regards. > > Sanjaya Vitharana > > ----- Original Message ----- > From: "Serge Aleynikov" > To: "Sanjaya Vitharana" > Sent: Friday, June 17, 2005 7:56 PM > Subject: Re: What I need is .... > > > >>I don't think it is possible in SNMP. It is not a restriction of the >>Erlang's implementation, but rather the SNMP RFC1157 standard. >> >>When using get or get_next you are only allowed to pass a valid OID. >>However, you are not required to have a "known" OID, i.e. you can append >>.N.M.K ... .Z indexes to any oid, as long as the agent can figure out >>how to deal with such an OID. >> >>Sanjaya Vitharana wrote: >> >> >>>Dear Serge, >>> >>>Many thanks for your reply. >>> >>>But what I need is not that ... I already picked the concept of MIB OID >>>concept & how it maped with the general table over the net. >>> >>>What I need is to call a funtion like >>>countLinks(get, BoardID)-> >>> >>>Shall I change it to >>>(1.) countLinks(get, AnyName)-> >>> >>>to get a proper understanding >>>------------------------------------------------ >>>I'm currently using a function like >>> >>>(2)countLinks(get) -> >>> >>> to call that I'm simply using >>>(manager@REDACTED)73> >>>snmpm:g("user",{127,0,0,1},4000,[[1,3,6,1,3,7,2,1,3,1]]). %% this is > > working > >>>which generate the get,[1],[3] >>>------------------------------------------------ >>>Assume I want to pass a Variable to above (1): -- if it is possible >>>So ... I'll create a Variable >>>(manager@REDACTED)73> Name = "Sanjaya". %% or any other >>> >>>Can I pass that variable to my above (1) method??? >>> >>>Like >>>(manager@REDACTED)73> >>>snmpm:g("user",{127,0,0,1},4000,[{[1,3,6,1,3,7,2,1,3,1], Name}]). %%( > > This > >>>may be wrong --- but you will get what I need) >>> >>>to generate a get call something like ,[1],[3], ["Sanjaya"] -This may > > wrong > >>>too ... >>> >>>Is it possible ....? >>> >>>---------------------------------------------------- >>>Ex: from simple programming >>> >>>I can write a method >>>3.)anyMethod(get)-> and call it like anyMethod(get). >>>also >>>I can change it to >>>anyMethod(get,AnyVar)-> and call it like anyMethod(get,"Sanjaya"). >>> >>>So.... >>> >>>If I change my (2)countLinks(get) -> to (1.) countLinks(get, AnyName)-> >>> >>>How should I call it from Manager??? >>> >>>Is it possible or not in SNMP ??? >>>---------------------------------------------------- >>> >>>Regards >>> >>>Sanjaya >>>##############################END#################################### >>>----- Original Message ----- >>>From: "Serge Aleynikov" >>>To: "Sanjaya Vitharana" >>>Sent: Friday, June 17, 2005 6:27 PM >>>Subject: Re: get method with extra Variable .... ? >>> >>> >>> >>> >>>>If the OID for your MIB's boardObject is [1,3,6,1,3,7,2,1,3,1] you call >>>>it from the manager as: >>>> >>>>boardObject.Index >>>> >>>>Where Index is the board number, i.e. BoardID = 4: >>>> >>>>[1,3,6,1,3,7,2,1,3,1,4] >>>> ^ >>>>Then the object's instrumentation function will need to figure out that >>>>4 is the "extra parameter" that corresponds to the index. >>>> >>>>You can read about SNMP tables - they are designed specifically to >>>>handle information of this sort. >>>> >>>>Sanjaya Vitharana wrote: >>>> >>>> >>>> >>>>>The proplem I have is not to write the function. But how it should be >>> >>>call >>> >>> >>>>>from manager .... with extra variable ? >>>> >>>>>I'm simply using the OID as belows >>>>> >>>>>(manager@REDACTED)73> >>>>>snmpm:g("user",{127,0,0,1},4000,[[1,3,6,1,3,7,2,1,3,1]]). >>>>> >>>>>But how I call the get with extra variable...?? >>>>> >>>>>Assume: >>>>>(manager@REDACTED)73> BoardID = 4. >>>>>(manager@REDACTED)73> snmpm:g("user",{127,0,0,1},4000, .... --- How > > write > >>>the >>> >>> >>>>>end with BoardID...? >>>>> >>>>>Sanjaya >>>>> >>>>>----- Original Message ----- >>>>>From: "Serge Aleynikov" >>>>>To: "Sanjaya Vitharana" >>>>>Sent: Friday, June 17, 2005 6:01 PM >>>>>Subject: Re: get method with extra Variable .... ? >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Yes if you define an SNMP table holding information about each Board, >>>>>>and use RowIndex to reference each table entry (in your case BoardID >>>>>>will be the RowIndex). >>>>>> >>>>>>Sanjaya Vitharana wrote: >>>>>> >>>>>> >>>>>> >>>>>>>is it possible to call a snmp get method with extra Variable .... ? >>>>>>> >>>>>>>something like >>>>>>> >>>>>>>countLinks(get, BoardID)-> >>>>>>> >>>>>>>BoardID should be 1,2,3 ....etc. (to count the links in some board) >>>>>>> >>>>>>>Sanjaya >>>>>>> From joe.armstrong@REDACTED Mon Jun 20 17:32:51 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 20 Jun 2005 17:32:51 +0200 Subject: XML and Erlang Message-ID: It seems like XML is not going to go away - I closed my eyes, screwed them up, put my fingers in my ears and waited for years - but it's still here, so can we do anything with it? Possibly :-) A few days ago I stumbled upon the "RELAX NG compact notation" - this is more or less "XML DTDs as they should have been" - James Clark has done a wonderful job here and invented a notation that is very similar to the informal type notation I have been using to define Erlang types for the last hundred years or so. This is so near that with a slight tweak Erlang terms can become XML data structures. Suddenly I realised that all the XML pasers I'd every written were wrong - sorry guys ... What was wrong and how can it be fixed? What's wrong with my XML parsers was the representation. I represented Children as {tag, AssociationListOfAttributes, [ Children ]} at first sight this looks ok - we don't know how many children an element has so we represent the children as a list of elements - this is WRONG. So what should it have been? Rember the old DTD's (the nice easy ones *before* the standardisation committees got their hands on them)? Suppose I write This means that a is a fixed length sequence of three items. How do we do fixed length sequences in Erlang? - yes - that's right tuples: Thus the parse tree of an a should be: {a, Attrs, {p(b), p(c), p(d) } when p(X) is the parse tree of X and NOT {a, Attrs, [p(b), p(c), p(d) ] } With this small twist it's easy to see the relationship between DTDs and erlang terms is thus represented as {a, Attrs, { p(b), [p(c)], p(d) } } What's this got to do with RELAX NG compact syntax? In the compact syntax you can say things like town = element town { attribute name { text } street* } This represents an XML data type like ... ... Or an Erlang term {town, [{name," Stockholm"}], [{street,...},...]} And the transformation between the two is pretty straightforward. Now town involved a data constructor - it is wrapper for a sequence of streets. The base case might be something like name = element name { text } an XML instance might be Joe or in Erlang {name, [], {value, "Joe"}} note that {value, "Joe"} can never be interpreted as the body of an element containing two sub-elements since in this case each of the sub elements would have to be a 3-tuple. This gives us with an "almost" canonical Erlang representation of XML (3-tuples for elements) 2-tuples for values - it's "almost" because of "white space issues" - disregarding white space issues I think this is a canonical representation. If it is then the following things are possible. - Compact encoding/decoding of XML (ie turn it into the canonical representation then use term-to-binary etc. - Verifying that a data instance is according to a particular DTD (easy) - Type inference of XML producing functions (ie run the dializer, and confert the inferred types back to XML) It also means that things like dynamic type checking in Erlang is almost identical to checking an instance of a XML datatype against a schema. Now all I have to do is re-write my latest and greatest XML parser, and write a RELAX NG compact syntax parser :-) /Joe From ulf.wiger@REDACTED Mon Jun 20 17:56:28 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 20 Jun 2005 17:56:28 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: > "Ulf Wiger" wrote: > > RPC1 - between two processes in the same Erlang node > > Here, we are 'guaranteed' that messages cannot be dropped. > > Where is that promised? I don't know. That's why I put it in quotes. (: In the Erlang Reference Manual, it says: "Sending a message to a pid never fails, even if the pid identifies a non-existing process." So you see, the message is guaranteed to get there, even if 'there' doesn't exist. That's quite some service guarantee! (: (I read it as "the send operation will not raise an exception, but whether the message is actually delivered is another matter entirely.") In the Erlang 4.7 specification, 10.6.2 (pg 158), it says: "It is guaranteed that if a process P1 dispatches two signals s1 and s2 to the same process P2, in that order, then signal s1 will never arrive after s2 at P2. It is ensured that whenever possible, a signal dispatched to a process should eventually arrive at it. There are situations when it is not reasonable to require that all signals arrive at their destination, in particular when a signal is sent to a process on a different node and communication between the nodes is temporarily lost." You don't have to tell me that this text carefully avoids leaving any sort of guarantee that a message sent will actually arrive given specific circumstances. It even avoids guaranteeing that s1 will have arrived before s2. This was however the 'guarantee' that I referred to. In practice, if you really need to make sure that a message has arrived, you must wait for explicit acknowledgement. However, it is commonly assumed that if a process is alive, a local message will reach it. It would be difficult to imagine the system not being able to deliver messages to a healthy process using local communication. Would this also extend to EXIT messages sent to supervisor processes? If so, supervision cannot be relied upon. > I can think of all sorts of reasons why RPC1 might be > unreliable. I didn't like the idea at first, but then > it dawned on me that if there are lots of messages being > sent to a process which, though live, isn't bothering to > listen (or is listening for the wrong thing), the mailbox > will eventually take over all available memory But if it's an RPC, the client will not send additional messages until it times out waiting for the response to the previous one. Eventually, one may assume that all potential clients, will be stuck waiting for that bad server. What happens when a client times out waiting for a server is of course application specific. One may simply retry, but in that case, the situation you describe may arise. One can also exit, which is the recommended (by way of implementation) procedure. Following the OTP guidelines, the client would normally die, and be restarted by its supervisor. This may trigger a new RPC1 to the server, which may also hang. Eventually, the configurable restart limit may kick in, and the supervisor will terminate, escalating the restart. When the escalation reaches the top (the application controller), the erlang VM is terminated (and possibly restarted by some HEART program.) Getting this to work smoothly and reliably takes quite a bit of thinking and tuning. But it's not rocket science. > to the detriment of other processes UNLESS at some point > messages are discarded. I may be wrong, but I don't think the Erlang VM does that. /Uffe From tony@REDACTED Mon Jun 20 22:28:42 2005 From: tony@REDACTED (Tony Rogvall) Date: Mon, 20 Jun 2005 22:28:42 +0200 Subject: XML and Erlang In-Reply-To: References: Message-ID: <71266D25-6C82-4E79-8DAF-9E48B215C651@rogvall.com> 20 jun 2005 kl. 17.32 skrev Joe Armstrong (AL/EAB): > > Suppose I write > > > Suppose I write Add some funky XHTML style INCLUDE/IGNORE macros :-) But yes I think that many of the XML ELEMENTS could be mapped to records, and I usually do this by hand. I HATE XML but have to live with it every day .... The Industry (name any kind) use XML without any kind of DTD. And if they do they tend to use it as some odd kind of comment. I have tons of XML that does not pass through any XML validation. I have even seen XML (thanks luke) that contained inlined DTD that did not validate!!! This means that tools must normally turn off validation and then the guessing starts ;-) Happy XML hacking everyone /Tony From vlad_dumitrescu@REDACTED Mon Jun 20 23:09:29 2005 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 20 Jun 2005 23:09:29 +0200 Subject: JInterface question References: <1CA2B2EC-3EA4-4894-8791-8A383CA2F587@gmail.com> <976F9E38-6BCE-4E37-A3C7-BBC240D773D1@gmail.com> Message-ID: Hi, From: "Olivier Sambourg" >I'm having another problem with erlang external format : an integer list >in erlang is sometimes encoded as a string (when the integers all are in >the 0..255 range). Yes, JInterface tries to be smart, about in the same way as the shell does. Lists of bytes are typed/printed as strings... Sometimes it is a blessing, sometimes a curse. If your data may contain strings or general lists, and you don't know beforehand which one it is, then it's a little tricky. You have to handle both cases. But in many cases, one can only get one of those types of lists. Then if you may have to convert an OtpErlangString to an OtpErlangList... However, OtpErlangString inherits from OtpErlangList, so it's not that difficult to handle them. The same problem exists (and is slightly worse) with all the integer types. There's too many of them! :-) regards, Vlad From erlang@REDACTED Tue Jun 21 04:23:52 2005 From: erlang@REDACTED (Michael McDaniel) Date: Mon, 20 Jun 2005 19:23:52 -0700 Subject: XML and Erlang In-Reply-To: <71266D25-6C82-4E79-8DAF-9E48B215C651@rogvall.com> References: <71266D25-6C82-4E79-8DAF-9E48B215C651@rogvall.com> Message-ID: <20050621022351.GB4723@fangora.autosys.us> On Mon, Jun 20, 2005 at 10:28:42PM +0200, Tony Rogvall wrote: > > 20 jun 2005 kl. 17.32 skrev Joe Armstrong (AL/EAB): > > > > > Suppose I write > > > > > > > > Suppose I write > > > > Add some funky XHTML style INCLUDE/IGNORE macros :-) > > But yes I think that many of the XML ELEMENTS could be mapped to > records, and I usually do this > by hand. > > I HATE XML but have to live with it every day .... > The Industry (name any kind) use XML without any kind of DTD. And if > they do they tend to use it as > some odd kind of comment. I have tons of XML that does not pass > through any XML validation. > I have even seen XML (thanks luke) that contained inlined DTD that > did not validate!!! > > This means that tools must normally turn off validation and then the > guessing starts ;-) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What I did in a recent project is to {validate, true} and then when it fails log the error and retry with {validate, false}. Hopefully the {validate, false} data gets processed ok in my remaining code (it has so far) and the error is documented for when it doesn't. Happily, the service provider of the XML data and DTD have been responsive to fix the DTD. It was only the occasional data that failed to validate so the retries were seldom. ~Michael > > Happy XML hacking everyone > > /Tony > From ulf@REDACTED Tue Jun 21 06:51:33 2005 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 21 Jun 2005 06:51:33 +0200 Subject: JInterface question In-Reply-To: References: <1CA2B2EC-3EA4-4894-8791-8A383CA2F587@gmail.com> <976F9E38-6BCE-4E37-A3C7-BBC240D773D1@gmail.com> Message-ID: Den 2005-06-20 23:09:29 skrev Vlad Dumitrescu : > If your data may contain strings or general lists, and you don't know > beforehand which one it is, then it's a little tricky. You have to > handle both cases. On the Erlang side, one may perhaps borrow a page from the UBF book (well, the feature was wholly undocumented, except for the code ;-) -define(S(S), {'#S', S}). s(Str) -> {'#S', S}. Perfectly obvious, no? The idea is that the ?S macro is used in pattern match as a deconstructor, and the s/1 function is used as a constructor, and all strings become wrapped in a tagged tuple. handle_call({hello, ?S(S)}, State) -> S1 = s(lists:reverse(S)), {reply, {hello, S1}, State}. /Uffe From ok@REDACTED Tue Jun 21 07:36:05 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 21 Jun 2005 17:36:05 +1200 (NZST) Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: <200506210536.j5L5a58Y448468@atlas.otago.ac.nz> "Ulf Wiger (AL/EAB)" wrote: [quotation 1, careful analysis showing that it doesn't imply that local messages are reliable] [quotation 2, careful analysis showing that it doesn't imply that local messages are reliable either] In practice, if you really need to make sure that a message has arrived, you must wait for explicit acknowledgement. Right. However, it is commonly assumed that if a process is alive, a local message will reach it. There's that terminally cute saying that "assume" makes an ASS out of U and ME. It would be difficult to imagine the system not being able to deliver messages to a healthy process using local communication. What's a healthy process? How can the message delivery code tell whether a process is healthy quickly enough for knowing to be useful? Would this also extend to EXIT messages sent to supervisor processes? If so, supervision cannot be relied upon. I don't need to tell you that there *automatically* generated EXIT messages might be more reliable than programmer-generated ones. If there is a rule that prevents supervision across node boundaries, I have failed to notice or understand it, in which case supervision does have trouble. > to the detriment of other processes UNLESS at some point > messages are discarded. I may be wrong, but I don't think the Erlang VM does that. There is more than one Erlang implementation, although the "real" one does have a habit of advancing faster than the others could keep up. (E2S, GERL, ...) If it's not promised explicitly somewhere, we can't rely on future Erlang implementations happening to miss the same opportunities. From ok@REDACTED Tue Jun 21 07:39:11 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 21 Jun 2005 17:39:11 +1200 (NZST) Subject: XML and Erlang Message-ID: <200506210539.j5L5dBEe453490@atlas.otago.ac.nz> Tony Rogvall wrote: Suppose I write Suppose you don't? That isn't legal XML syntax and never has been. While "&" is a feature of SGML that I rather like, it has certain technical problems which mean that it was deliberately left out of XML. From tony@REDACTED Tue Jun 21 09:23:06 2005 From: tony@REDACTED (Tony Rogvall) Date: Tue, 21 Jun 2005 09:23:06 +0200 Subject: XML and Erlang In-Reply-To: <200506210539.j5L5dBEe453490@atlas.otago.ac.nz> References: <200506210539.j5L5dBEe453490@atlas.otago.ac.nz> Message-ID: <65AD5164-5369-435E-87EB-76DE5B790BB6@rogvall.com> On Jun 21, 2005, at 7:39 AM, Richard A. O'Keefe wrote: > Tony Rogvall wrote: > Suppose I write > > > > Suppose you don't? That isn't legal XML syntax and never has been. > While "&" is a feature of SGML that I rather like, it has certain > technical problems which mean that it was deliberately left out of > XML. > Suppose you remove the & and replace it with the expansion? Please let me try to explain. (a & b) == (a, b) | (b,a) (a & b & c) == (a,b,c) | (a,c,b) | (b,a,c) | (b,c,a) | (c,a,b) | (a,b,a) Then what? /Tony From bjorn@REDACTED Tue Jun 21 09:44:47 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 21 Jun 2005 09:44:47 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: "Ulf Wiger (AL/EAB)" writes: > > to the detriment of other processes UNLESS at some point > > messages are discarded. > > I may be wrong, but I don't think the Erlang VM does that. Correct. It doesn't. As long as the process is alive, it is guaranteed to receive all messages sent (locally) to it. We have no intention to change that behaviour. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ulf.wiger@REDACTED Tue Jun 21 14:08:26 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 21 Jun 2005 14:08:26 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: Richard A. O'Keefe wrote: > "Ulf Wiger (AL/EAB)" wrote: > > However, it is commonly assumed that if a process is alive, > a local message will reach it. > > There's that terminally cute saying that "assume" makes an ASS > out of U and ME. In this case, the assumption is fairly deeply rooted in actual understanding of the Ericsson implementation of Erlang. As you noted elsewhere, there are extreme circumstances under which a message simply cannot be delivered. The one that springs to mind is when there isn't enough memory available. > > It would be difficult to imagine the system not being able to > deliver messages to a healthy process using local communication. > > What's a healthy process? I fail to imagine any other alternatives than: - the erlang node is healthy (e.g. not out of memory), and - the process is not dead. > How can the message delivery code > tell whether a process is healthy quickly enough for > knowing to be useful? It can quickly determine whether the process is alive. It will eventually discover where the node runs out of memory. Handling the out-of-memory situation gracefully is a dilemma. I think steps have been taken to improve the behaviour. > Would this > also extend to EXIT messages sent to supervisor processes? > If so, supervision cannot be relied upon. > > I don't need to tell you that there *automatically* generated > EXIT messages might be more reliable than programmer-generated > ones. One might think so, yes, but the one occasion I can remember where attempted message delivery failed, actually involved EXIT messages. I had a node with ~ 100,000 processes, all linked to the shell process. The shell process died as I misspelled length(processes()), which made the system try to deliver an EXIT message containing, among other things, a list of >100,000 pids. Since the standard Erlang VM copies messages on send, it ended up trying to create 100,000 copies of the rather large EXIT message. This kept my workstation busy for the better part of 10 minutes, and then the entire VM died. If one were to formulate a guarantee, I guess it would be something along the lines of "if a message is sent to a local process which is alive, the runtime system will either deliver the message or die trying." One could imagine other strategies for handling exceptional conditions. > If there is a rule that prevents supervision across > node boundaries, I have failed to notice or understand > it, in which case supervision does have trouble. There is no such rule. Supervision across node boundaries is indeed problematic. I would hesitate to use the supervisor behaviour in such a way that child processes run on a node different from that of the supervisor. > > to the detriment of other processes UNLESS at some point > > messages are discarded. > > I may be wrong, but I don't think the Erlang VM does that. > > There is more than one Erlang implementation, although the > "real" one does have a habit of advancing faster than the > others could keep up. (E2S, GERL, ...) If it's not promised > explicitly somewhere, we can't rely on future Erlang > implementations happening to miss the same opportunities. I think the idea of discarding messages might be a way forward, but think that one must go further than to just randomly discard them. It is very useful to know for sure that if s1 and s2 have been sent from P1 to P2, then if s2 arrives, s1 is guaranteed to have arrived before it. The spec doesn't state this, but it's what I think it should state. That would mean that if you start discarding messages to a process, you had better continue to discard them, until the program somehow takes action (an appropriate action might be to restart the process whose mailbox has been effectively disabled.) /Uffe From alex.arnon@REDACTED Tue Jun 21 16:59:50 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 21 Jun 2005 17:59:50 +0300 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <944da41d050621075918ae1471@mail.gmail.com> On 6/21/05, Ulf Wiger (AL/EAB) wrote: [snip] > > I think the idea of discarding messages might be a way forward, > but think that one must go further than to just randomly > discard them. It is very useful to know for sure that if > s1 and s2 have been sent from P1 to P2, then if s2 arrives, > s1 is guaranteed to have arrived before it. The spec doesn't > state this, but it's what I think it should state. > > That would mean that if you start discarding messages to > a process, you had better continue to discard them, until > the program somehow takes action (an appropriate action > might be to restart the process whose mailbox has been > effectively disabled.) > > /Uffe > Would there be a reason to prefer random discard? I.e., if we rephrase ...if s2 arrives then s1 is guaranteed to have arrived before it... to ...if s2 arrives then s1 is guaranteed to have either arrived before it or never arrived. This would then simulate a congested network, which might be a more "generic" way of handling memory-full situations. From ulf.wiger@REDACTED Tue Jun 21 17:08:38 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 21 Jun 2005 17:08:38 +0200 Subject: Getting locks and sharing: was RE: Getting concurrency Message-ID: Alex Arnon wrote: > > Would there be a reason to prefer random discard? I.e., if we > rephrase > ...if s2 arrives then s1 is guaranteed to have arrived > before it... > to > ...if s2 arrives then s1 is guaranteed to have either arrived > before it or never arrived. > > This would then simulate a congested network, which might be a more > "generic" way of handling memory-full situations. Personally, I think this would be unfortunate, because then, you must add sophistication to your program. The guarantee that s1 will have been delivered if s2 was delivered, means e.g. that you can do things like acknowledge every 10th message in an internal transfer protocol. Then, the sender knows that all messages to that point have also arrived. Another given with such a guarantee is the serialization property. This allows you to reason in a fundamentally different way in situations where synchronization is important. An example: In the gen_leader program, I wrote a replicated dictionary. This implementation is entirely faulty if you must assume that messages can be arbitrarily dropped, because you cannot know that all preceding writes were actually committed to a backup copy, simply because the last one was. This forfeits the underlying reasoning behind much of gen_leader. (Which is not _the_ reason why I object -- rather a fairly descriptive example of how you might program given the presence of such guarantees.) /Uffe From david.nospam.hopwood@REDACTED Tue Jun 21 18:00:19 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Tue, 21 Jun 2005 17:00:19 +0100 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <42B83993.5060205@blueyonder.co.uk> Ulf Wiger (AL/EAB) wrote: > I think the idea of discarding messages might be a way forward, > but think that one must go further than to just randomly > discard them. It is very useful to know for sure that if > s1 and s2 have been sent from P1 to P2, then if s2 arrives, > s1 is guaranteed to have arrived before it. The spec doesn't > state this, but it's what I think it should state. I agree. Note that E, which is also a distributed asynchronous message passing system, does make this guarantee. If a message cannot be delivered to a given reference (~= Erlang port), the reference becomes "broken", and will receive no more messages. References that are not broken eventually receive all the messages sent to them, in causal order (see ). However, it is also possible to create "sturdy refs" which survive failure of vats (~= Erlang nodes). -- David Hopwood From alex.arnon@REDACTED Tue Jun 21 18:32:49 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 21 Jun 2005 19:32:49 +0300 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: References: Message-ID: <944da41d05062109328657657@mail.gmail.com> On 6/21/05, Ulf Wiger (AL/EAB) wrote: > > Alex Arnon wrote: > > > > Would there be a reason to prefer random discard? I.e., if we > > rephrase > > ...if s2 arrives then s1 is guaranteed to have arrived > > before it... > > to > > ...if s2 arrives then s1 is guaranteed to have either arrived > > before it or never arrived. > > > > This would then simulate a congested network, which might be a more > > "generic" way of handling memory-full situations. > > Personally, I think this would be unfortunate, because then, you > must add sophistication to your program. > > The guarantee that s1 will have been delivered if s2 was delivered, > means e.g. that you can do things like acknowledge every 10th > message in an internal transfer protocol. Then, the sender knows > that all messages to that point have also arrived. > > Another given with such a guarantee is the serialization property. > This allows you to reason in a fundamentally different way in > situations where synchronization is important. > > An example: In the gen_leader program, I wrote a replicated > dictionary. This implementation is entirely faulty if you > must assume that messages can be arbitrarily dropped, > because you cannot know that all preceding writes were actually > committed to a backup copy, simply because the last one was. > This forfeits the underlying reasoning behind much of gen_leader. > (Which is not _the_ reason why I object -- rather a fairly > descriptive example of how you might program given the presence > of such guarantees.) > > /Uffe > I see. There is indeed a great advantage to the assumption (apologies, all :) ) that when using locally-spawned processes, all communication between them is ensured - design is greatly simplified. From mikael.karlsson@REDACTED Tue Jun 21 19:35:16 2005 From: mikael.karlsson@REDACTED (Mikael Karlsson) Date: Tue, 21 Jun 2005 19:35:16 +0200 Subject: XML and Erlang In-Reply-To: References: Message-ID: <200506211935.18174.mikael.karlsson@creado.com> Mon 20 juni 2005 17:32 Joe Armstrong (AL/EAB wrote): . > A few days ago I stumbled upon the "RELAX NG compact notation" - this > is more or less "XML DTDs as they should have been" - James Clark has done > a wonderful job here and invented a notation that is very similar to the > informal type notation I have been using to define Erlang types for the > last hundred years or so. .. > Now all I have to do is re-write my latest and greatest XML parser, and > write a RELAX NG compact syntax parser :-) > > /Joe Has anyone looked at XQuery ( by Philip Wadler et.al?) It should have some similarities to the Relax NG syntax. http://www.xml.com/pub/a/2002/06/19/rng-compact.html Regards Mikael From ok@REDACTED Wed Jun 22 04:56:30 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 22 Jun 2005 14:56:30 +1200 (NZST) Subject: XML and Erlang Message-ID: <200506220256.j5M2uU5T458179@atlas.otago.ac.nz> Tony Rogvall suggested: which I pointed out was not legal XML. He replied: Suppose you remove the & and replace it with the expansion? Please let me try to explain. (a & b) == (a, b) | (b,a) (a & b & c) == (a,b,c) | (a,c,b) | (b,a,c) | (b,c,a) | (c,a,b) | (a,b,a) This kind of exponential explosion is part of _why_ it was left out of XML. Things like (b & c & d)* are more than slightly weird. However, whenever we have (x1 & ... & xn) we can treat this as insignificant variation in the input and always map it to a canonical order. So could all be given the same internal form, as they all recognise the same sequences. The internal form could be the same as the internal form for Now any mix of | and , can be put into a standard form where "|" is the top level operator; let's agree to treat x? as (x|EMPTY), which is not actually legal. Sequences like x* and x+ can be mapped to lists. In this case, we'd get /* Prolog */ a([{}(B1,C1,D1),...,{}(BN,CN,DN)]) | a(C,D) /* Erlang */ {a,[{B1,C1,D1},...,{BN,CN,DN}]} | {a,C,D} However, let's consider a more interesting example, interesting to me because it's something I'm using at the moment (documentation for Smalltalk) and because it was not contrived for the purpose. Clearly maps to Pro: st([Class,...]) erl: [Class,...] Tricky! The construction "p,(p|example)*" crops up in several places. The intention is that every description should begin with a paragraph, not an example. But processing doesn't actually care, and I would like that combination consistently treated as (p|example)+. Let's assume that that's done through some kind of magic. The mapping we want here is Pro: class(Name,Parent,Ansi,Abstract,Elements, [P or Example,...], [Cat,...], [Ccat,...]) Erl: {class,Name,Parent,Ansi,Abstract,Elements, [P or Example,...], [Cat,...], [Ccat,...]) where Parent is an atom or 0 and Ansi is an atom or 0. No problem here, just some wrapper around a string. No problem here. Pro: p([String or C or M or V or Em or X or Protocol, ...]) Erl: {p,[String or C or M or V or Em or X or Protocol, ...]} Like p. Like example. No problem here either: Pro: c(N) Erl: {c,N} All like . No problem here: Pro: cat(For, [Method,...]) Erl: {cat,For,[Method,...]} An additional optimisation can be applied for Erlang: in a context where the tag is predictable (as it is for argument), the tag may be omitted, so Erl': {For,[Method,...]} Here we have two problems. One is the p,(p|example)* problem mentioned above. I'll assume the same magical answer. The other is how to treat x?. One way is to treat x? as (x|EMPTY) and expand out, which would result in Pro: method(Header,[Argument,...],Result,[P or Example,...]) method(Header,[Argument,...],[P or Example,...]) and the other is to treat it as (x|MISSING), where MISSING maps to something (such as 0) which cannot otherwise occur. The latter seems preferable. This also handles #IMPLIED attributes. Pro: method(Header,Ansi or 0,[Argument,...], Result or 0,[P or Example,...]) Erl: {method,Header,Ansi or 0,[Argument,...], Result or 0,[P or Example,...]) Erl': {Header,Ansi or 0,[Argument,]]], Result or 0,[P or Example,...]) Like No problem here: Pro: argument(Name,Type or 0,Captured) Erl: {argument,Name,Type or 0,Captured} Erl': {Name,Type or 0,Captured} No problem here: Pro: result(Type or 0,Source) Erl: {result,Type or 0,Source} Erl': {Type or 0,Source} No problem here either: Pro: ccat(For,[Method,...]) Erl: {ccat,For,[Method,...]} Erl': {For,[Method,...]} There's a guide-line which I've never explicitly formulated, but which is often followed, and which explains why the mapping from XML to Prolog or Erlang is so easy in this case: Never nest ','. That is, model --> (#PCDATA|tag1|...|tagn)* | (item1,...,itemn) item --> tag_or_choice [?|+|*] tag_or_choice --> tag | (tag1|...|tagn) The only common exception I can call to mind is except that what the HTML specifications *really* say is In short, I don't really believe that a direct XML->Erlang mapping *is* as straightforward as it might seem, but for the kinds of DTDs that people actually write, characterised by that simplified context model grammar above, it *is* fairly straightforward. One difference between SGML and XML is that XML always allows "any other attribute", but if an application *cared* about other attributes, they'd have been mentioned in the DTD or Schema, so it's OK to strip other attributes off in the mapping to Erlang (or Prolog). Oh, that optimisation I mentioned above applies to a tag whenever it is never part of the "choice" alternative of a tag_or_choice. From dietmar@REDACTED Wed Jun 22 10:44:04 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Wed, 22 Jun 2005 10:44:04 +0200 Subject: Creating a Target System versus OTP Release Handling Tutorial (xml) Message-ID: <42B924D4.3010408@ast.dfs.de> Hi ! I have some problems understanding the main difference in both mentioned tutorials. The purpose is - as far as I can see - the same but the procedure is different. Which way is preferable ? Under R10B-5: systools:make_script("cmmc",[{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]). =ERROR REPORT==== 22-Jun-2005::10:30:26 === Error in process <0.29.0> with exit value: {undef,[{systools,make_script,["cmmc",[{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {undef,[{systools,make_script, ["cmmc", [{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** Under R10-B4: *WARNING* snmp: Source code not found: snmp.erl . . .*WARNING* snmp: Source code not found: snmp_verbosity.erl ok The warnings were addressed by another email and that shouldn't be a problem. Dietmar From bjorn@REDACTED Wed Jun 22 10:51:15 2005 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 22 Jun 2005 10:51:15 +0200 Subject: Erlang/OTP R10B-6 has been released Message-ID: Bug fix release : otp_src_R10B-6 Build date : 2005-06-22 This is bug fix release 6 for the R10B release. You can download the full source distribution from http://www.erlang.org/download/otp_src_R10B-6.tar.gz http://www.erlang.org/download/otp_src_R10B-6.readme Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R10B-6.exe The documentation at http://www.erlang.org will be updated. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R10B-6.tar.gz http://www.erlang.org/download/otp_doc_man_R10B-6.tar.gz For some OTP applications there are more detailed release notes in the HTML documentation. We also want to thank those that sent us patches, suggestions and bug reports, The OTP Team -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From dietmar@REDACTED Wed Jun 22 12:12:47 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Wed, 22 Jun 2005 12:12:47 +0200 Subject: starting my release fails Message-ID: <42B9399F.7040100@ast.dfs.de> Hi ! I just built a release more or less according to the release_handling_tutorial When I start my app I get: {"init terminating in do_boot",{'cannot load',error_handler,get_file}} Crash dump was written to: erl_crash.dump init terminating in do_boot () P.S. I am using R10B-5 Here is my start script: erl -boot /home/dietmar/cmmc-foc/releases/1.0/cmmc -mnesia dir '"/opt/cmmc/db"' -sname cmmc -setcookie 4dp-cmmc-foc -config /home/dietmar/cmmc-foc/lib/ cmmc-1.0/config/sys2 -pa ["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"] -il ["../mibs"] I attached the erl_scrash_dump hoping that someone can give a hint ! Regards Dietmar -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_crash.dump.gz Type: application/x-gunzip Size: 10246 bytes Desc: not available URL: From gunilla@REDACTED Wed Jun 22 12:19:31 2005 From: gunilla@REDACTED (Gunilla Arendt) Date: Wed, 22 Jun 2005 12:19:31 +0200 Subject: Creating a Target System versus OTP Release Handling Tutorial (xml) In-Reply-To: <42B924D4.3010408@ast.dfs.de> References: <42B924D4.3010408@ast.dfs.de> Message-ID: <42B93B33.7050207@erix.ericsson.se> In "Creating a First Target System" (a chapter in "System Principles") it is described how to make a target system consisting of a number of Erlang/OTP applications together with a number of user-defined applications, all in one "package". One can say you create an alternative version of the Erlang/OTP release, where all unused Erlang/OTP applications are removed and your own applications are added instead. All applications are located under ROOT/lib, where ROOT is the root directory of this target system. In OTP Release Handling Tutorial (at trapexit.org), the target system instead consists of an existing Erlang/OTP release "as is" together with a number of user-defined applications located in a separate lib directory. About which one is preferable: In my opinion, either way is fine. The error report means that the module systools is not found. / Gunilla Dietmar Schaefer wrote: > Hi ! > > > I have some problems understanding the main difference in both mentioned > tutorials. > > The purpose is - as far as I can see - the same but the procedure is > different. > > > > Which way is preferable ? > > > > Under R10B-5: > > systools:make_script("cmmc",[{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]). > > > =ERROR REPORT==== 22-Jun-2005::10:30:26 === > Error in process <0.29.0> with exit value: > {undef,[{systools,make_script,["cmmc",[{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} > > > ** exited: {undef,[{systools,make_script, > ["cmmc", > > [{path,["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"]}]]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > > > Under R10-B4: > *WARNING* snmp: Source code not found: snmp.erl > . > . > .*WARNING* snmp: Source code not found: snmp_verbosity.erl > ok > > > The warnings were addressed by another email and that shouldn't be a > problem. > > > > Dietmar From sanjaya@REDACTED Wed Jun 22 13:22:37 2005 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Wed, 22 Jun 2005 17:22:37 +0600 Subject: SNMP MIB Data type - equivalent to Erlang "atom" ? Message-ID: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> Hi....!!!, !!!!!....Can any body help me to sort this out.....!!!! What is the MIB Data type equivalent to "atom" ? For Example: assume that I have a function: ---------------------------------------------------- getAtom(get) -> {value, anyatom}. %% note that returning value is an atom of "anyatom" ---------------------------------------------------- How Should I map it in MIB (What is the Type ?) myAtom OBJECT-TYPE SYNTAX ***What is the equivalent data type to put here*** %%I know How to handle INTEGER/DisplayString (FROM RFC1213-MIB). But atom ??? ACCESS read-write STATUS mandatory DESCRIPTION "" ::= { myObjects 1 } ---------------------------------------------------- Regards, Sanjaya -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Wed Jun 22 14:07:14 2005 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 22 Jun 2005 08:07:14 -0400 Subject: SNMP MIB Data type - equivalent to Erlang "atom" ? In-Reply-To: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> References: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> Message-ID: <42B95472.6000106@hq.idt.net> You need to use DisplayString type in your MIB, and use {value, atom_to_list(anyatom)} in your instrumentation function. Also, to answer your former question on accessing the agent from other hosts - remove {intAgentIpAddress, [127,0,0,1]} entry from agent.config file, or change that IP to the public one assigned to the interface. Serge Sanjaya Vitharana wrote: > Hi....!!!, > > !!!!!....Can any body help me to sort this out.....!!!! > > What is the MIB Data type equivalent to "atom" ? > > For Example: > > assume that I have a function: > ---------------------------------------------------- > getAtom(get) -> > {value, anyatom}. %% note that returning value is an atom of "anyatom" > ---------------------------------------------------- > How Should I map it in MIB (What is the Type ?) > > myAtom OBJECT-TYPE > SYNTAX ***What is the equivalent data type to put > here*** %%I know How to handle INTEGER/DisplayString (FROM > RFC1213-MIB). But atom ??? > ACCESS read-write > STATUS mandatory > DESCRIPTION > "" > ::= { myObjects 1 } > ---------------------------------------------------- > Regards, > > Sanjaya From mfs@REDACTED Wed Jun 22 16:46:25 2005 From: mfs@REDACTED (Mark Scandariato) Date: Wed, 22 Jun 2005 10:46:25 -0400 Subject: Erlang/OTP R10B-6 has been released In-Reply-To: References: Message-ID: Does the debugger now support modules containing try clauses? Mark. On Jun 22, 2005, at 4:51 AM, Bjorn Gustavsson wrote: > Bug fix release : otp_src_R10B-6 > Build date : 2005-06-22 > > This is bug fix release 6 for the R10B release. > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R10B-6.tar.gz > http://www.erlang.org/download/otp_src_R10B-6.readme > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R10B-6.exe > > The documentation at http://www.erlang.org will be updated. You can > also download the complete HTML documentation or the Unix manual files > > http://www.erlang.org/download/otp_doc_html_R10B-6.tar.gz > http://www.erlang.org/download/otp_doc_man_R10B-6.tar.gz > > For some OTP applications there are more detailed release notes in the > HTML documentation. > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The OTP Team > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > From ulf.wiger@REDACTED Wed Jun 22 18:14:21 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 22 Jun 2005 18:14:21 +0200 Subject: starting my release fails Message-ID: Looking into the crash dump at the list of loaded modules, you find: =mod:otp_ring0 Current size: 533 =mod:init Current size: 32094 =mod:prim_inet Current size: 35232 =mod:prim_file Current size: 25724 =mod:erl_prim_loader Current size: 21817 =mod:erlang The most common mistake in boot scripts, IME, is to start a script build with an older OTP, and fail to load the modules. If you run your system in embedded mode, then all modules will be loaded at boot time, and all paths must be correct. In normal, on-demand, mode, only the most basic modules will be loaded, and then the ones called upon during boot. In your case, only the preloaded modules have been loaded. In an example script: {script,{"OTP APN 181 01","R10B"}, [{preLoaded,[erlang, erl_prim_loader, prim_file, prim_inet, init, otp_ring0]}, {progress,preloaded}, {path,["$ROOT/lib/kernel-2.10/ebin","$ROOT/lib/stdlib-1.13/ebin"]}, In the .rel file, you find a nice overview of the different application versions. Also the start_erl.data might be worth looking into for the erts version (although that doesn't seem to be the problem this time.) My guess is that the path to the kernel application was wrong, and that this triggered the error. Given that this mistake is so easy to make, perhaps there should be a warning or more descriptive error message? /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Dietmar Schaefer > Sent: den 22 juni 2005 12:13 > To: erlang-questions@REDACTED > Subject: starting my release fails > > > Hi ! > > > I just built a release more or less according to the > release_handling_tutorial > > > When I start my app I get: > > > {"init terminating in do_boot",{'cannot > load',error_handler,get_file}} > > Crash dump was written to: erl_crash.dump > init terminating in do_boot () > > P.S. > > I am using R10B-5 > > > > Here is my start script: > > > erl -boot /home/dietmar/cmmc-foc/releases/1.0/cmmc -mnesia dir > '"/opt/cmmc/db"' -sname cmmc -setcookie 4dp-cmmc-foc -config > /home/dietmar/cmmc-foc/lib/ > cmmc-1.0/config/sys2 -pa ["/home/dietmar/cmmc-foc/lib/cmmc-1.0/ebin"] > -il ["../mibs"] > > > > I attached the erl_scrash_dump hoping that someone can give a hint ! > > > Regards > > > > Dietmar > From ulf.wiger@REDACTED Wed Jun 22 17:49:16 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 22 Jun 2005 17:49:16 +0200 Subject: Erlang/OTP R10B-6 has been released Message-ID: Bj?rn wrote: > This is bug fix release 6 for the R10B release. > You can download the full source distribution from >From the readme: Incorrect calls such as M:42() would crash the compiler. The compiler now generates a warning. (Thanks to Ulf Wiger.) That was generous. All I did was write crappy code that happened to crash the compiler. The OTP team did the analysis and fixed the problem. (: Anyway, I thank you humbly. It is sometimes rewarding to write bad code. (: /Uffe From joelr1@REDACTED Wed Jun 22 20:14:43 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 22 Jun 2005 20:14:43 +0200 Subject: Problem with node name Message-ID: <04BB4315-56A3-44AD-B08B-E7ED6C90C8D8@gmail.com> Folks, Having a node name like this: c-6881e055 apparently causes problems within Erlang. Trying to install a Mnesia schema on such a node complains about the e055 portion. Thanks, Joel From chandrashekhar.mullaparthi@REDACTED Wed Jun 22 20:51:33 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 22 Jun 2005 19:51:33 +0100 Subject: Problem with node name In-Reply-To: <04BB4315-56A3-44AD-B08B-E7ED6C90C8D8@gmail.com> References: <04BB4315-56A3-44AD-B08B-E7ED6C90C8D8@gmail.com> Message-ID: <08bb17ae3e5776118b8c7ead4d768663@t-mobile.co.uk> Chandrus-Mac:~/temp chandru$ erl -sname abcd Erlang (BEAM) emulator version 5.2 [source] Eshell V5.2 (abort with ^G) (abcd@REDACTED)1> (abcd@REDACTED)1> (abcd@REDACTED)1> mnesia:create_schema([node()]). ok (abcd@REDACTED)2> mnesia:delete_schema([node()]). ok (abcd@REDACTED)3> mnesia:create_schema([abcd@REDACTED]). ** exited: {{unbound,'Mac'},[{erl_eval,expr,3}]} ** (abcd@REDACTED)4> mnesia:create_schema(['abcd@REDACTED']). ok Putting the nodename within '' takes care of all the funny characters in the nodename. cheers Chandru On 22 Jun 2005, at 19:14, Joel Reymont wrote: > Folks, > > Having a node name like this: c-6881e055 apparently causes problems > within Erlang. > Trying to install a Mnesia schema on such a node complains about the > e055 portion. > > Thanks, Joel > From joelr1@REDACTED Wed Jun 22 21:00:33 2005 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 22 Jun 2005 21:00:33 +0200 Subject: Problem with node name In-Reply-To: <08bb17ae3e5776118b8c7ead4d768663@t-mobile.co.uk> References: <04BB4315-56A3-44AD-B08B-E7ED6C90C8D8@gmail.com> <08bb17ae3e5776118b8c7ead4d768663@t-mobile.co.uk> Message-ID: <2523EAAD-5F71-48C3-A5A5-D8C0337F9CD2@gmail.com> On Jun 22, 2005, at 8:51 PM, Chandrashekhar Mullaparthi wrote: > Putting the nodename within '' takes care of all the funny > characters in the nodename. This is what I mean: erl -sname mb1 -mnesia extra_db_nodes \[master1@REDACTED\] -s mnesia start Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) (mb1@REDACTED)1> =ERROR REPORT==== 22-Jun-2005::20:58:07 === application_controller: syntax error before: e055: [master1@REDACTED] (mb1@REDACTED)1> erl -sname mb1 -mnesia extra_db_nodes \['master1@REDACTED'\] -s mnesia start Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) (mb1@REDACTED)1> =ERROR REPORT==== 22-Jun-2005::20:59:19 === application_controller: syntax error before: e055: [master1@REDACTED] (mb1@REDACTED)1> halt(). From serge@REDACTED Wed Jun 22 23:41:09 2005 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 22 Jun 2005 17:41:09 -0400 Subject: SNMP MIB Data type - equivalent to Erlang "atom" ? In-Reply-To: <20050622.233553.74724810.mbj@bluetail.com> References: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> <42B95472.6000106@hq.idt.net> <20050622.233553.74724810.mbj@bluetail.com> Message-ID: <42B9DAF5.8050708@hq.idt.net> True. Though, in that case anyatom can't really be any atom, but a predefined enumerated set. Martin Bjorklund wrote: > Serge Aleynikov wrote: > >>You need to use DisplayString type in your MIB, and use >>{value, atom_to_list(anyatom)} in your instrumentation function. > > > Or use an integer enum in the MIB. The agent will convert the atom to > the appropriate integer. > > > /martin > > > > >>Also, to answer your former question on accessing the agent from other >>hosts - remove {intAgentIpAddress, [127,0,0,1]} entry from agent.config >>file, or change that IP to the public one assigned to the interface. >> >>Serge >> >>Sanjaya Vitharana wrote: >> >>>Hi....!!!, >>> >>>!!!!!....Can any body help me to sort this out.....!!!! >>> >>>What is the MIB Data type equivalent to "atom" ? >>> >>>For Example: >>> >>>assume that I have a function: >>>---------------------------------------------------- >>>getAtom(get) -> >>> {value, anyatom}. %% note that returning value is an atom of "anyatom" >>>---------------------------------------------------- >>>How Should I map it in MIB (What is the Type ?) >>> >>> myAtom OBJECT-TYPE >>> SYNTAX ***What is the equivalent data type to put >>>here*** %%I know How to handle INTEGER/DisplayString (FROM >>>RFC1213-MIB). But atom ??? >>> ACCESS read-write >>> STATUS mandatory >>> DESCRIPTION >>> "" >>> ::= { myObjects 1 } >>>---------------------------------------------------- >>>Regards, >>> >>>Sanjaya > > -- Serge Aleynikov R&D Telecom, IDT Corp. Tel: (973) 438-3436 Fax: (973) 438-1464 serge@REDACTED From ok@REDACTED Thu Jun 23 03:35:13 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 23 Jun 2005 13:35:13 +1200 (NZST) Subject: XML and Erlang Message-ID: <200506230135.j5N1ZDwd471817@atlas.otago.ac.nz> I've just written some code to measure how big a parsed document would be using several different representations. This is the same DTD I used as an example yesterday, except that a couple of attributes are really (large) enumerations and I didn't show you those. There's a 5.4 ratio between best and worst overall. But the really important factor is NOT whether you use a general-purpose XML representation or one tailored to your particular problem, it's HOW YOU STORE STRINGS. Now when we are processing XML, it is quite true that much of the time we actually ignore the strings and just transform one structure to another structure, so it's the amount of memory we TOUCH that matters, not the amount of memory we HOLD. But we do have to allocate and fill in all that memory, and it does have to be reclaimed. It looks as though the biggest space win for Erlang might be representing parsed character data and attribute values other than enumeration values as binaries rather than lists. The original document was 31707 bytes, excluding the DTD. Size is reported in 32-bit words. Language is Erlang (cost model: [_|_] = 3 words, {X1,...,Xn} = n+2 words), Prolog (WAM cost model), or Smalltalk (a non-interactive Smalltalk dialect with cost model unindexed object = 1 + #slots words, indexed object = 2 + #slots words + element space). C is just C. Elem.rep is generic, meaning that it's like the current Erlang XML representation in working for _any_ XML with or without a DTD or schema, or specific, meaning that it is tailored to this particular DTD. Erlang,specific is basically the tightly packed "Erl'" version I outlined yesterday. String rep is string=atom for Erlang and Prolog, string=list (of integers) for Erlang and Prolog, char=byte (1 byte per Latin-1 character) or char=word (4 bytes per 21-bit Unicode character) for Smalltalk, or "my DVM2 library" which uses UTF8 + unique storage. The string=atom case is a useful approximation to what a string=binary representatin would cost. Size Language Elem.rep String rep 11779 words Smalltalk, specific, char=byte 13384 words Prolog, specific, string=atom 15912 words Smalltalk, generic, char=byte 16151 words Erlang, specific, string=atom 17820 words Prolog, generic, string=atom 18673 words C, generic, my DVM2 library. 22735 words Erlang, generic, string=atom 29343 words Smalltalk, specific, char=word 34583 words Smalltalk, generic, char=word 53101 words Prolog, specific, string=list 54918 words Erlang, specific, string=list 59752 words Prolog, generic, string=list 63441 words Erlang, generic, string=list "Honesty is praised and starves." -- Juvenal From sanjaya@REDACTED Thu Jun 23 06:13:02 2005 From: sanjaya@REDACTED (Sanjaya Vitharana) Date: Thu, 23 Jun 2005 10:13:02 +0600 Subject: SNMP MIB Data type - equivalent to Erlang "atom" ? References: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> <42B95472.6000106@hq.idt.net> <20050622.233553.74724810.mbj@bluetail.com> <42B9DAF5.8050708@hq.idt.net> Message-ID: <003a01c577a9$dbc89060$6900a8c0@wavenet.lk> Dear Sege/Martin, What both of you are telling I can understand.(about some data type of "integer enum" or "predefined enumerated set" in the MIB) But applying that "integer enum" type in the MIB is a bit problem for me. Hence I'm going back to my previous question with the term of "integer enum". ---------------------------------------------------- So.....How Should I apply "integer enum" in MIB myAtom OBJECT-TYPE SYNTAX *********What is the Equelant to put here******** %%Or in other words how to write "integer enum" data type in MIB. ACCESS read-write STATUS mandatory DESCRIPTION "" ::= { myObjects 1 } ---------------------------------------------------- Regards, Sanjaya Vitharana ----- Original Message ----- From: "Serge Aleynikov" To: "Martin Bjorklund" Cc: ; Sent: Thursday, June 23, 2005 3:41 AM Subject: Re: SNMP MIB Data type - equivalent to Erlang "atom" ? > True. Though, in that case anyatom can't really be any atom, but a > predefined enumerated set. > > Martin Bjorklund wrote: > > > Serge Aleynikov wrote: > > > >>You need to use DisplayString type in your MIB, and use > >>{value, atom_to_list(anyatom)} in your instrumentation function. > > > > > > Or use an integer enum in the MIB. The agent will convert the atom to > > the appropriate integer. > > > > > > /martin > > > > > > > > > >>Also, to answer your former question on accessing the agent from other > >>hosts - remove {intAgentIpAddress, [127,0,0,1]} entry from agent.config > >>file, or change that IP to the public one assigned to the interface. > >> > >>Serge > >> > >>Sanjaya Vitharana wrote: > >> > >>>Hi....!!!, > >>> > >>>!!!!!....Can any body help me to sort this out.....!!!! > >>> > >>>What is the MIB Data type equivalent to "atom" ? > >>> > >>>For Example: > >>> > >>>assume that I have a function: > >>>---------------------------------------------------- > >>>getAtom(get) -> > >>> {value, anyatom}. %% note that returning value is an atom of "anyatom" > >>>---------------------------------------------------- > >>>How Should I map it in MIB (What is the Type ?) > >>> > >>> myAtom OBJECT-TYPE > >>> SYNTAX ***What is the equivalent data type to put > >>>here*** %%I know How to handle INTEGER/DisplayString (FROM > >>>RFC1213-MIB). But atom ??? > >>> ACCESS read-write > >>> STATUS mandatory > >>> DESCRIPTION > >>> "" > >>> ::= { myObjects 1 } > >>>---------------------------------------------------- > >>>Regards, > >>> > >>>Sanjaya > > > > > > -- > Serge Aleynikov > R&D Telecom, IDT Corp. > Tel: (973) 438-3436 > Fax: (973) 438-1464 > serge@REDACTED > From raimo@REDACTED Thu Jun 23 08:52:09 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 23 Jun 2005 08:52:09 +0200 Subject: Erlang/OTP R10B-6 has been released References: , Message-ID: No, sorry! Alas I got other things higher prioritized all the time. mfs@REDACTED (Mark Scandariato) writes: > Does the debugger now support modules containing try clauses? > > Mark. > On Jun 22, 2005, at 4:51 AM, Bjorn Gustavsson wrote: > > > Bug fix release : otp_src_R10B-6 > > Build date : 2005-06-22 > > > > This is bug fix release 6 for the R10B release. > > You can download the full source distribution from > > > > http://www.erlang.org/download/otp_src_R10B-6.tar.gz > > http://www.erlang.org/download/otp_src_R10B-6.readme > > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > > > For installation instructions please read the README that is part of > > the distribution. > > > > The Windows binary distribution can be downloaded from > > > > http://www.erlang.org/download/otp_win32_R10B-6.exe > > > > The documentation at http://www.erlang.org will be updated. You can > > also download the complete HTML documentation or the Unix manual files > > > > http://www.erlang.org/download/otp_doc_html_R10B-6.tar.gz > > http://www.erlang.org/download/otp_doc_man_R10B-6.tar.gz > > > > For some OTP applications there are more detailed release notes in the > > HTML documentation. > > > > We also want to thank those that sent us patches, suggestions and bug > > reports, > > > > The OTP Team > > > > -- > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo@REDACTED Thu Jun 23 09:01:37 2005 From: raimo@REDACTED (Raimo Niskanen) Date: 23 Jun 2005 09:01:37 +0200 Subject: Problem with node name References: <08bb17ae3e5776118b8c7ead4d768663@t-mobile.co.uk>, <08bb17ae3e5776118b8c7ead4d768663@t-mobile.co.uk>, <2523EAAD-5F71-48C3-A5A5-D8C0337F9CD2@gmail.com> Message-ID: I think the problem is not in mnesia; it is just that '-' is not a valid character in an atom, so the atom must be quoted with single quotes: 'a-tom'. A you see in the error printout: > application_controller: syntax error before: e055: [master1@REDACTED] the node name atom has not been quoted, so it is interpreted as: [ 'master1@REDACTED' - 6881 'e055' ] hence, invalid syntax. You will have to convince your shell to pass the single quotes into the erl program. Perhaps try: erl -sname mb1 -mnesia extra_db_nodes "['master1@REDACTED']" \ -s mnesia start Are you shure the '[]' brackets are supposed to bee there too? joelr1@REDACTED (Joel Reymont) writes: > On Jun 22, 2005, at 8:51 PM, Chandrashekhar Mullaparthi wrote: > > > Putting the nodename within '' takes care of all the funny > > characters in the nodename. > > This is what I mean: > > erl -sname mb1 -mnesia extra_db_nodes \[master1@REDACTED\] -s > mnesia start > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > (mb1@REDACTED)1> > =ERROR REPORT==== 22-Jun-2005::20:58:07 === > application_controller: syntax error before: e055: [master1@REDACTED] > (mb1@REDACTED)1> > > erl -sname mb1 -mnesia extra_db_nodes \['master1@REDACTED'\] -s > mnesia start > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > (mb1@REDACTED)1> > =ERROR REPORT==== 22-Jun-2005::20:59:19 === > application_controller: syntax error before: e055: [master1@REDACTED] > > (mb1@REDACTED)1> halt(). > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From luvishsatija@REDACTED Thu Jun 23 09:48:40 2005 From: luvishsatija@REDACTED (luvish satija) Date: Thu, 23 Jun 2005 08:48:40 +0100 (BST) Subject: emfile error. Message-ID: <20050623074841.59028.qmail@web8502.mail.in.yahoo.com> Hi all, I'm running an erlang server which accepts tcp connections from clients and in turn spawns a new process for every new connection to handle it. To test its capability, I run a Client process which can spawn any number of baby-clients. So i choose 10000. Now the problem is that after nearabout 1020 clients, I start getting the "emfile" error and this occurs on both sides i.e. client and server side. Previously I was getting "enfile" error which I fixed by setting ERL_MAX_PORTS to 10000. I expected that this should solve the problem, but it went futile. I am a newbie to erlang, so I'm not able to figure out if i'm doing any silly mistake. Any kind of relevant guidance would really help me. Thanks in advance, Luvish Satija __________________________________________________________ How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com From ulf.wiger@REDACTED Thu Jun 23 10:40:53 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 23 Jun 2005 10:40:53 +0200 Subject: Problem with node name Message-ID: Raimo Niskanen wrote: > > You will have to convince your shell to pass the single quotes > into the erl program. Perhaps try: > erl -sname mb1 -mnesia extra_db_nodes > "['master1@REDACTED']" \ > -s mnesia start The double and single quotes make the difference, at least on Solaris. > Are you shure the '[]' brackets are supposed to bee there too? Yes, they do. /Uffe From ulf.wiger@REDACTED Thu Jun 23 11:08:00 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 23 Jun 2005 11:08:00 +0200 Subject: XML and Erlang Message-ID: Richard A. O'Keefe wrote: > > It looks as though the biggest space win for Erlang might be > representing parsed character data and attribute values other > than enumeration values as binaries rather than lists. Presumably, with string=atom, you would get the added advantage of "compression", since each unique atom is stored only once, which is not usually the case for binaries (you'd have to implement your own binary cache on the heap in order to reuse pointers, but this would be useless if the aim is to reduce the size of the external representation). It would of course also bring the added disadvantage of potentially filling the atom table, since it's not garbage collected, and cannot be manually purged either. Looking at the external representation, you can disregard the atom cache, and each atom would take about (exactly?) the same space as a corresponding binary. /Uffe From chandrashekhar.mullaparthi@REDACTED Thu Jun 23 12:11:26 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 23 Jun 2005 11:11:26 +0100 Subject: emfile error. In-Reply-To: <20050623074841.59028.qmail@web8502.mail.in.yahoo.com> References: <20050623074841.59028.qmail@web8502.mail.in.yahoo.com> Message-ID: <0c9289ee3b738423ba87f966dce4581b@t-mobile.co.uk> Before you start your client/server, do this in your shell ulimit -n 10000 This will set the number of available file descriptors for processes started from that shell. Then start your client and server. This is assuming the kernel settings allow that many file descriptors. If not you'll have to change that limit first before tweaking it in your shell. cheers Chandru On 23 Jun 2005, at 08:48, luvish satija wrote: > Hi all, > > I'm running an erlang server which accepts tcp > connections from clients and in turn spawns a new > process for every new connection to handle it. > > To test its capability, I run a Client process which > can spawn any number of baby-clients. So i choose > 10000. Now the problem is that after nearabout 1020 > clients, I start getting the "emfile" error and this > occurs on both sides i.e. client and server side. > > Previously I was getting "enfile" error which I fixed > by setting ERL_MAX_PORTS to 10000. I expected that > this should solve the problem, but it went futile. > > I am a newbie to erlang, so I'm not able to figure out > if i'm doing any silly mistake. Any kind of relevant > guidance would really help me. > > Thanks in advance, > > Luvish Satija > > > > __________________________________________________________ > How much free photo storage do you get? Store your friends 'n family > snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com > From joe.armstrong@REDACTED Thu Jun 23 14:14:07 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 23 Jun 2005 14:14:07 +0200 Subject: Changing how binaries are printed: was RE: XML and Erlang Message-ID: Richard A. O'Keefe wrote: > I've just written some code to measure how big a parsed document > would be using several different representations. This is the same > DTD I used as an example yesterday, except that a couple of attributes > are really (large) enumerations and I didn't show you those. > > There's a 5.4 ratio between best and worst overall. > But the really important factor is NOT whether you use a > general-purpose > XML representation or one tailored to your particular problem, > it's HOW YOU STORE STRINGS. Yes :-) Of course you're right.... So I changed my XML parser to represent both atoms and string as binaries, I ran it and - I couldn't read the results :-) So - I *changed* io_lib.erl to pretty print binaries containing printable strings correctly :-) With this change the binary <<"cat">> prints as <<"cat">> and NOT <<99,97,116>> Suddenly I can read and *debug* programs with binaries in them. I realise that my reluctance to use binaries was due to the difficulty of debugging programs with binaries in them. So if you patch io_lib.erl as follows just define > write_binary(B, D) -> > S = size(B), > {B2, Dots} = if > S > D -> > {B1, _} = split_binary(B, D), > {B1, "..."}; > true -> > {B, ""} > end, > List = binary_to_list(B2), > case printable_list(List) of > true -> > ["<<\"",List,Dots,"\">>"]; > false -> > write_binary1(B, D) > end. > and rename the old write_binry as write_binary1 Then binaries will be printed in a readable manner IMHO this should be added to the standard distribution /Joe From serge@REDACTED Thu Jun 23 14:47:26 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 23 Jun 2005 08:47:26 -0400 Subject: emfile error. In-Reply-To: <20050623074841.59028.qmail@web8502.mail.in.yahoo.com> References: <20050623074841.59028.qmail@web8502.mail.in.yahoo.com> Message-ID: <42BAAF5E.7020705@hq.idt.net> There have been multiple posts regarding this on the mailing list (you can do a search on "ulimit"). There is an OS limit of the number of file descriptors (default 1024) that can be increased with "ulimit -n NEW_LIMIT" before starting the emulator. Serge luvish satija wrote: > Hi all, > > I'm running an erlang server which accepts tcp > connections from clients and in turn spawns a new > process for every new connection to handle it. > > To test its capability, I run a Client process which > can spawn any number of baby-clients. So i choose > 10000. Now the problem is that after nearabout 1020 > clients, I start getting the "emfile" error and this > occurs on both sides i.e. client and server side. > > Previously I was getting "enfile" error which I fixed > by setting ERL_MAX_PORTS to 10000. I expected that > this should solve the problem, but it went futile. > > I am a newbie to erlang, so I'm not able to figure out > if i'm doing any silly mistake. Any kind of relevant > guidance would really help me. > > Thanks in advance, > > Luvish Satija From david.nospam.hopwood@REDACTED Thu Jun 23 15:15:35 2005 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 23 Jun 2005 14:15:35 +0100 Subject: Getting locks and sharing: was RE: Getting concurrency In-Reply-To: <944da41d05062109328657657@mail.gmail.com> References: <944da41d05062109328657657@mail.gmail.com> Message-ID: <42BAB5F7.4060402@blueyonder.co.uk> Alex Arnon wrote: > On 6/21/05, Ulf Wiger (AL/EAB) wrote: > >>Another given with such a guarantee is the serialization property. >>This allows you to reason in a fundamentally different way in >>situations where synchronization is important. >> >>An example: In the gen_leader program, I wrote a replicated >>dictionary. This implementation is entirely faulty if you >>must assume that messages can be arbitrarily dropped, >>because you cannot know that all preceding writes were actually >>committed to a backup copy, simply because the last one was. >>This forfeits the underlying reasoning behind much of gen_leader. >>(Which is not _the_ reason why I object -- rather a fairly >>descriptive example of how you might program given the presence >>of such guarantees.) > > I see. There is indeed a great advantage to the assumption (apologies, > all :) ) that when using locally-spawned processes, all communication > between them is ensured - design is greatly simplified. The assumption isn't that all communication is ensured; in the case of two processes it is that the messages received are a prefix of the messages sent. (More generally, that the messages received are consistent with causal ordering -- which is easier to use than it is to define.) You can't really ensure anything stronger than this in an asynchronous message passing system where processes can fail. -- David Hopwood From thomasl_erlang@REDACTED Thu Jun 23 15:41:02 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 23 Jun 2005 06:41:02 -0700 (PDT) Subject: Changing how binaries are printed: was RE: XML and Erlang In-Reply-To: Message-ID: <20050623134102.54567.qmail@web41907.mail.yahoo.com> --- "Joe Armstrong (AL/EAB)" wrote: > Then binaries will be printed in a readable manner > > IMHO this should be added to the standard > distribution Hear hear. And the equivalent fix should be applied for list-strings when printed with ~w. Best, Thomas ____________________________________________________ Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com From serge@REDACTED Thu Jun 23 16:47:30 2005 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 23 Jun 2005 10:47:30 -0400 Subject: SNMP MIB Data type - equivalent to Erlang "atom" ? In-Reply-To: <003a01c577a9$dbc89060$6900a8c0@wavenet.lk> References: <015f01c5771c$b181a360$6900a8c0@wavenet.lk> <42B95472.6000106@hq.idt.net> <20050622.233553.74724810.mbj@bluetail.com> <42B9DAF5.8050708@hq.idt.net> <003a01c577a9$dbc89060$6900a8c0@wavenet.lk> Message-ID: <42BACB82.3090906@hq.idt.net> Though it is beyond the scope of this mailing list, here is a sample MIB definition containing an integer enum: balanceMethod OBJECT-TYPE SYNTAX INTEGER { random(0), roundRobin(1), leastTime(2) } MAX-ACCESS read-write STATUS current DESCRIPTION "Back-end server balancing method" ::= { drpProxyObjects 17 } Serge Sanjaya Vitharana wrote: > Dear Sege/Martin, > > What both of you are telling I can understand.(about some data type of > "integer enum" or "predefined enumerated set" in the MIB) > > But applying that "integer enum" type in the MIB is a bit problem for me. > > Hence I'm going back to my previous question with the term of "integer > enum". > ---------------------------------------------------- > So.....How Should I apply "integer enum" in MIB > > myAtom OBJECT-TYPE > SYNTAX *********What is the Equelant to put here******** > %%Or in other words how to write "integer enum" data type in MIB. > ACCESS read-write > STATUS mandatory > DESCRIPTION > "" > ::= { myObjects 1 } > ---------------------------------------------------- > Regards, > > Sanjaya Vitharana > > > > ----- Original Message ----- > From: "Serge Aleynikov" > To: "Martin Bjorklund" > Cc: ; > Sent: Thursday, June 23, 2005 3:41 AM > Subject: Re: SNMP MIB Data type - equivalent to Erlang "atom" ? > > > >>True. Though, in that case anyatom can't really be any atom, but a >>predefined enumerated set. >> >>Martin Bjorklund wrote: >> >> >>>Serge Aleynikov wrote: >>> >>> >>>>You need to use DisplayString type in your MIB, and use >>>>{value, atom_to_list(anyatom)} in your instrumentation function. >>> >>> >>>Or use an integer enum in the MIB. The agent will convert the atom to >>>the appropriate integer. >>> >>> >>>/martin >>> >>> >>> >>> >>> >>>>Also, to answer your former question on accessing the agent from other >>>>hosts - remove {intAgentIpAddress, [127,0,0,1]} entry from agent.config >>>>file, or change that IP to the public one assigned to the interface. >>>> >>>>Serge >>>> >>>>Sanjaya Vitharana wrote: >>>> >>>> >>>>>Hi....!!!, >>>>> >>>>>!!!!!....Can any body help me to sort this out.....!!!! >>>>> >>>>>What is the MIB Data type equivalent to "atom" ? >>>>> >>>>>For Example: >>>>> >>>>>assume that I have a function: >>>>>---------------------------------------------------- >>>>>getAtom(get) -> >>>>> {value, anyatom}. %% note that returning value is an atom of > > "anyatom" > >>>>>---------------------------------------------------- >>>>>How Should I map it in MIB (What is the Type ?) >>>>> >>>>> myAtom OBJECT-TYPE >>>>> SYNTAX ***What is the equivalent data type to put >>>>>here*** %%I know How to handle INTEGER/DisplayString (FROM >>>>>RFC1213-MIB). But atom ??? >>>>> ACCESS read-write >>>>> STATUS mandatory >>>>> DESCRIPTION >>>>> "" >>>>> ::= { myObjects 1 } >>>>>---------------------------------------------------- >>>>>Regards, >>>>> >>>>>Sanjaya >>> >>> >>-- >>Serge Aleynikov >>R&D Telecom, IDT Corp. >>Tel: (973) 438-3436 >>Fax: (973) 438-1464 >>serge@REDACTED From ok@REDACTED Fri Jun 24 04:55:58 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 24 Jun 2005 14:55:58 +1200 (NZST) Subject: XML and Erlang Message-ID: <200506240255.j5O2twpo478491@atlas.otago.ac.nz> I wrote: > It looks as though the biggest space win for Erlang might be > representing parsed character data and attribute values other > than enumeration values as binaries rather than lists. I had a reason for recommending binaries rather than atoms. "Ulf Wiger (AL/EAB)" replied: Presumably, with string=atom, you would get the added advantage of "compression", since each unique atom is stored only once, which is not usually the case for binaries ... It so happens that my C library for processing XML already does "hash consing" for *everything*, not just strings. I've never seen an example where this didn't help; on the other hand, I've never seen an example where it helped *much*. 10% is not unreasonable (and even most of that comes from attribute values). The real payoff is that when you transform from one XML format to another, the new tree shares lots of space with the old, which is something that happens in functional languages anyway. It would of course also bring the added disadvantage of potentially filling the atom table, since it's not garbage collected, and cannot be manually purged either. Exactly so. With binaries, you could always do the old LOGIX trick: if you test whether two binaries are equal, and they are, change the variable that pointed to the newer copy to point to the older. From luvishsatija@REDACTED Fri Jun 24 07:31:08 2005 From: luvishsatija@REDACTED (luvish satija) Date: Fri, 24 Jun 2005 06:31:08 +0100 (BST) Subject: Mnesia Overloading Problem. Message-ID: <20050624053108.33356.qmail@web8504.mail.in.yahoo.com> Hello all, I am trying to run a server with mnesia as database. When the server is hit hard ( with more than 10000 clients), the following errors start popping up in the shell on the server side: =ERROR REPORT==== 24-Jun-2005::10:48:31 === Error in process <0.3550.0> on node 'server@REDACTED' with exit value: {{badmatch,{aborted,{system_limit,"Cannot create an ets table for the local transaction store",{system_limit,[{ets,new,[mnesia_trans_store,[bag,public]]},{mnesia_tm,doit_loop,1},{mnesia_sp,init_proc,4},{proc_lib,... =ERROR REPORT==== 24-Jun-2005::10:48:35 === ** Too many db tables ** =ERROR REPORT==== 24-Jun-2005::10:48:50 === Mnesia(server@REDACTED): ** WARNING ** Mnesia is overloaded: {mnesia_tm,message_queue_len, [3156,3105]} And their number is enormous i.e. as the number of clients increases, the frequency of errors also increases. I am sure that the problem is with memory, but how to change the default settings. While creating the mnesia schema and tables, I am using the default properties. Somebody please help me out of this sea of errors. Thanks in advance, Luvish _______________________________________________________ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com From mickael.remond@REDACTED Fri Jun 24 10:29:33 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Fri, 24 Jun 2005 10:29:33 +0200 Subject: Mnesia Overloading Problem. In-Reply-To: <20050624053108.33356.qmail@web8504.mail.in.yahoo.com> References: <20050624053108.33356.qmail@web8504.mail.in.yahoo.com> Message-ID: <42BBC46D.1000200@erlang-fr.org> luvish satija wrote: > Hello all, > I am trying to run a server with mnesia as database. > When the server is hit hard ( with more than 10000 > clients), the following errors start popping up in the > =ERROR REPORT==== 24-Jun-2005::10:48:35 === > ** Too many db tables ** > You have probably reach a system default limit. From the Erlang efficiency guide (standard Erlang documentation): The default maximum number of ETS table is 1400. This can be changed with the environment variable ERL MAX ETS TABLES. I hope this helps, -- Micka?l R?mond http://www.erlang-projects.org/ From dietmar@REDACTED Fri Jun 24 12:16:44 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Fri, 24 Jun 2005 12:16:44 +0200 Subject: my process does not get started Message-ID: <42BBDD8C.3050709@ast.dfs.de> Hi ! I finally built all stuff to be able to start my application in embedded mode. (starting up at boot time). What I have is: cmmc_app.erl is an application behaviour which calls cmmc_4dp:start() which is the main starting routine of my application. (NO SUPERVISOR at this time) :-( my cmmc.script file contains: {path,["/opt/cmmc/Release-1.0/ebin"]}, {primLoad,[cmmc_util,cmmc_snmp,cmmc_d4,cmmc_config,cmmc_com,cmmc_4dp]}, {progress,modules_loaded}, {path,["/usr/local/otp_src_R10B-4/lib/erlang/lib/kernel-2.10.6/ebin", "/usr/local/otp_src_R10B-4/lib/erlang/lib/stdlib-1.13.5/ebin", "/usr/local/otp_src_R10B-4/lib/erlang/lib/sasl-2.0.1/ebin", "/usr/local/otp_src_R10B-4/lib/erlang/lib/mnesia-4.2.1/ebin", "/usr/local/otp_src_R10B-4/lib/erlang/lib/snmp-4.1.2/ebin", "/opt/cmmc/Release-1.0/ebin"]}, {kernelProcess,heart,{heart,start,[]}}, {kernelProcess,error_logger,{error_logger,start_link,[]}}, {kernelProcess,application_controller, . . . {apply,{application,load, [{application, cmmc, [{description,"CMMC module for 4dp"}, {vsn,"1.0"}, {id,[]}, {modules, [cmmc_d4, cmmc_com, cmmc_snmp, cmmc_util, cmmc_4dp, cmmc_config]}, {registered, [comDecode,sendProc,cmmc_config]}, {applications, [kernel,mnesia,stdlib,sasl,snmp]}, {included_applications,[]}, {env,[]}, {start_phases,undefined}, {maxT,infinity}, {maxP,infinity}]}]}}, {progress,applications_loaded}, {apply,{application,start_boot,[kernel,permanent]}}, {apply,{application,start_boot,[stdlib,permanent]}}, {apply,{application,start_boot,[sasl,permanent]}}, {apply,{application,start_boot,[mnesia,permanent]}}, {apply,{application,start_boot,[snmp,permanent]}}, * {apply,{application,start_boot,[cmmc,permanent]}},* {apply,{c,erlangrc,[]}}, {progress,started}]}. The problem is : my application does not get started. Can please somebody give me a hint ? BTW: I can call application:start(cmmc) which reports cmmc is already running but I cannot get connected to the communication process implemented in cmmc_com, Regards Dietmar From chandrashekhar.mullaparthi@REDACTED Fri Jun 24 13:21:53 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 24 Jun 2005 12:21:53 +0100 Subject: my process does not get started In-Reply-To: <42BBDD8C.3050709@ast.dfs.de> References: <42BBDD8C.3050709@ast.dfs.de> Message-ID: <3e237cb01dc10cf7143bec60dc993ae0@t-mobile.co.uk> Hi, On 24 Jun 2005, at 11:16, Dietmar Schaefer wrote: > Hi ! > > > I finally built all stuff to be able to start my application in > embedded mode. > (starting up at boot time). > > > What I have is: > > > > cmmc_app.erl is an application behaviour > which calls cmmc_4dp:start() which is the main starting routine of > my application. > > (NO SUPERVISOR at this time) :-( > > > my cmmc.script file contains: > > > {apply,{application,load, > [{application, > cmmc, > [{description,"CMMC module for 4dp"}, > {vsn,"1.0"}, > {id,[]}, > {modules, > [cmmc_d4, > cmmc_com, > cmmc_snmp, > cmmc_util, > cmmc_4dp, > cmmc_config]}, > {registered, > > [comDecode,sendProc,cmmc_config]}, > {applications, > > [kernel,mnesia,stdlib,sasl,snmp]}, > {included_applications,[]}, > {env,[]}, > {start_phases,undefined}, > {maxT,infinity}, > {maxP,infinity}]}]}}, In your cmmc.app file, you need a {mod, cmmc_app} entry - that seems to be missing. Add this entry and rebuild the boot file and it should work. cheers Chandru From mats.cronqvist@REDACTED Fri Jun 24 17:02:03 2005 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Fri, 24 Jun 2005 17:02:03 +0200 Subject: erl_prettypr Message-ID: <42BC206B.5040607@ericsson.com> hello, i'm trying to make a erl-html filter using syntax-tools (works so-so), but i've found this annoying behaviour. if i have this in a file (named tst.erl); foo(Bla,X)->%hello Bla. running this beauty; F="tst.erl",erl_prettypr:format(erl_recomment:recomment_forms(element(2,epp_dodger:parse_file(F)),erl_comment_scan:file(F))). will give this; "foo(Bla,\n X) ->%hello\n Bla. there shouldn't be a line break between Bla and X. and indeed, if the comment is removed there isn't. anybody got any advice? mats From serge@REDACTED Sat Jun 25 00:07:58 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 24 Jun 2005 18:07:58 -0400 Subject: inets crashing in R10B-6 Message-ID: <42BC843E.5070405@hq.idt.net> Hi, I upgraded Erlang to R10B-6 and for some reason inets keeps crashing at startup. Before upgrading it worked under R10B-5 with no problems. >erl Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] Eshell V5.4.8 (abort with ^G) 1>httpd:start_link(["../priv/inets.conf"]). =SUPERVISOR REPORT==== 24-Jun-2005::17:58:36 === Supervisor: {local,httpd_instance_sup_8080} Context: start_error Reason: {{listen,eafnosupport}, {child,undefined, {httpd_acceptor,any,8080}, {httpd_acceptor, start_link, [<0.66.0>, ip_comm, any, 8080, httpd_conf_8080, silence]}, permanent, 1000, worker, [httpd_acceptor]}} ... Here is the content of "../priv/inets.conf": ------BEGIN--------- BindAddress * Port 8080 ServerName wwwproxy ServerRoot ../priv DocumentRoot ../priv/docroot Modules mod_alias mod_auth mod_actions mod_include mod_dir mod_get mod_head DirectoryIndex index.html ErlScriptAlias /erl io io_lib server_mgr ------END--------- Any idea how to configure it in order to avoid this {listen,eafnosupport} "address family not supported by protocol family" error? Serge From serge@REDACTED Sat Jun 25 00:37:17 2005 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 24 Jun 2005 18:37:17 -0400 Subject: inets crashing in R10B-6 In-Reply-To: <42BC843E.5070405@hq.idt.net> References: <42BC843E.5070405@hq.idt.net> Message-ID: <42BC8B1D.9040007@hq.idt.net> I set up a trace on gen_tcp:listen, and see that httpd is trying to bind to inet6, which is indeed the root of this problem on this host: 5> dbg:tracer(). {ok,<0.47.0>} 6> dbg:p(all,call). {ok,[{matched,nonode@REDACTED,25}]} 7> dbg:tpl(httpd_transport, listen, dbg:fun2ms(fun(_) -> return_trace() end)). {ok,[{matched,nonode@REDACTED,0},{saved,1}]} 8> dbg:tpl(gen_tcp, listen, dbg:fun2ms(fun(_) -> return_trace() end)). {ok,[{matched,nonode@REDACTED,1},{saved,1}]} 9> httpd:start_link(["../priv/inets.conf"]). (<0.59.0>) call gen_tcp:listen(8080,[inet6,{ip,any},{packet,0},{active,false},{backlog,128},{reuseaddr,true}]) (<0.59.0>) returned from gen_tcp:listen/2 -> {error,eafnosupport} ** exited: shutdown ** How can I force httpd not to use inet6? Did some default setting change in R10B-6? I see this statement in the release notes, but not sure if it is related: OTP-5576 When doing an inet6 name lookup on an IPv4 address it was possible to get an address on IPv4 format back. This has been corrected. Some other minor inconsistencies regarding IPv6 name lookup have also been corrected. Thanks, Serge Serge Aleynikov wrote: > Hi, > > I upgraded Erlang to R10B-6 and for some reason inets keeps crashing at > startup. Before upgrading it worked under R10B-5 with no problems. > > >erl > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] > > Eshell V5.4.8 (abort with ^G) > 1>httpd:start_link(["../priv/inets.conf"]). > > =SUPERVISOR REPORT==== 24-Jun-2005::17:58:36 === > Supervisor: {local,httpd_instance_sup_8080} > Context: start_error > Reason: {{listen,eafnosupport}, > {child,undefined, > {httpd_acceptor,any,8080}, > {httpd_acceptor, > start_link, > [<0.66.0>, > ip_comm, > any, > 8080, > httpd_conf_8080, > silence]}, > permanent, > 1000, > worker, > [httpd_acceptor]}} > ... > > Here is the content of "../priv/inets.conf": > ------BEGIN--------- > BindAddress * > Port 8080 > ServerName wwwproxy > > ServerRoot ../priv > DocumentRoot ../priv/docroot > Modules mod_alias mod_auth mod_actions mod_include mod_dir > mod_get mod_head > > DirectoryIndex index.html > > ErlScriptAlias /erl io io_lib server_mgr > ------END--------- > > Any idea how to configure it in order to avoid this > {listen,eafnosupport} "address family not supported by protocol family" > error? > > Serge > -- Serge Aleynikov R&D Telecom, IDT Corp. Tel: (973) 438-3436 Fax: (973) 438-1464 serge@REDACTED From dietmar@REDACTED Sat Jun 25 08:00:46 2005 From: dietmar@REDACTED (Dietmar Schaefer) Date: Sat, 25 Jun 2005 08:00:46 +0200 Subject: process crashes after start Message-ID: <42BCF30E.5030903@ast.dfs.de> Hi ! Thanks to Chandrashekhar Mullaparthi I could solve the problem of "my application does not get started". My application does get started but terminates *straight* *away* ! I can call it manually like so: cmmc_sup:start(normal,[]). But if it gets started by the application controller it fails. =CRASH REPORT==== 25-Jun-2005::07:58:00 === crasher: pid: <0.192.0> registered_name: [] error_info: "invalid return value from cmmc_sup:start(normal,[]) -> {'EXIT',{undef,\n [{cmmc_db,start,[]},\n {cmmc_4dp,startall,0},\n {application_master,start_it_old,4}]}}" initial_call: {application_master,init, [<0.5.0>, <0.191.0>, {appl_data, cmmc, [comDecode,sendProc,cmmc_config], undefined, {cmmc_sup,[]}, [cmmc_d4, cmmc_com, cmmc_snmp, cmmc_util, cmmc_4dp, cmmc_config, cmmc_app, cmmc_sup], [], infinity, infinity}, normal]} ancestors: [<0.191.0>] messages: [{'EXIT',<0.193.0>,normal}] links: [<0.191.0>,<0.5.0>] dictionary: [] trap_exit: true status: running heap_size: 987 stack_size: 21 reductions: 91 neighbours: =INFO REPORT==== 25-Jun-2005::07:58:00 === application: cmmc exited: "invalid return value from cmmc_sup:start(normal,[]) -> {'EXIT',{undef,\n [{cmmc_db,start,[]},\n {cmmc_4dp,startall,0},\n {application_master,start_it_old,4}]}}" type: permanent Eshell V5.4.5 (abort with ^G) (cmmc@REDACTED)1> {"Kernel pid terminated",application_controller,shutdown} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) (shutdown) I just cannot figure out what's wrong here. I I have no idea how to interpret the erl_crash.dump Any help is most welcome regards Dietmar From sean.hinde@REDACTED Sat Jun 25 12:20:22 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Sat, 25 Jun 2005 11:20:22 +0100 Subject: process crashes after start In-Reply-To: <42BCF30E.5030903@ast.dfs.de> References: <42BCF30E.5030903@ast.dfs.de> Message-ID: <9468C2ED-39E2-484A-A051-C2ED6E847D95@mac.com> On 25 Jun 2005, at 07:00, Dietmar Schaefer wrote: > =CRASH REPORT==== 25-Jun-2005::07:58:00 === > crasher: > pid: <0.192.0> > registered_name: [] > error_info: "invalid return value from cmmc_sup:start(normal,[]) > -> {'EXIT',{undef,\n > [{cmmc_db,start,[]},\n > {cmmc_4dp,startall,0},\n > {application_master,start_it_old,4}]}}" > > > I just cannot figure out what's wrong here. undef means undefined function. So your function cmmc_db:start/0 is not in the path for demand loading, or if you are starting an embedded system it was not pre-loaded. It is worth checking that all the modules you want are listed in the .app file. > > I I have no idea how to interpret the erl_crash.dump There is a web based tool provided with OTP which helps with this: http://erlang.se/doc/doc-5.4.8/lib/webtool-0.8.2/doc/html/index.html Sean From chandrashekhar.mullaparthi@REDACTED Sun Jun 26 22:24:06 2005 From: chandrashekhar.mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Sun, 26 Jun 2005 21:24:06 +0100 Subject: process crashes after start In-Reply-To: <42BCF30E.5030903@ast.dfs.de> References: <42BCF30E.5030903@ast.dfs.de> Message-ID: <83e511a8fe1e4d8d019f81dada5bb3d4@t-mobile.co.uk> Dietmar, Your cmmc_app module is not in your cmmc.app file - that is why the module is not found. Add it to your boot file and you should be fine. btw, I tried to reply to the private message you sent me but your spam filter keeps rejecting my messages! cheers Chandru On 25 Jun 2005, at 07:00, Dietmar Schaefer wrote: > Hi ! > > > Thanks to Chandrashekhar Mullaparthi I could solve the problem of "my > application does not get started". > > My application does get started but terminates *straight* > *away* > ! > > > I can call it manually like so: > > > cmmc_sup:start(normal,[]). > > > > But if it gets started by the application controller it fails. > > > > =CRASH REPORT==== 25-Jun-2005::07:58:00 === > crasher: > pid: <0.192.0> > registered_name: [] > error_info: "invalid return value from cmmc_sup:start(normal,[]) -> > {'EXIT',{undef,\n > [{cmmc_db,start,[]},\n > {cmmc_4dp,startall,0},\n > {application_master,start_it_old,4}]}}" > initial_call: {application_master,init, > [<0.5.0>, > <0.191.0>, > {appl_data, > cmmc, > > [comDecode,sendProc,cmmc_config], > undefined, > {cmmc_sup,[]}, > [cmmc_d4, > cmmc_com, > cmmc_snmp, > cmmc_util, > cmmc_4dp, > cmmc_config, > cmmc_app, > cmmc_sup], > [], > infinity, > infinity}, > normal]} > ancestors: [<0.191.0>] > messages: [{'EXIT',<0.193.0>,normal}] > links: [<0.191.0>,<0.5.0>] > dictionary: [] > trap_exit: true > status: running > heap_size: 987 > stack_size: 21 > reductions: 91 > neighbours: > > =INFO REPORT==== 25-Jun-2005::07:58:00 === > application: cmmc > exited: "invalid return value from cmmc_sup:start(normal,[]) -> > {'EXIT',{undef,\n > [{cmmc_db,start,[]},\n > {cmmc_4dp,startall,0},\n > {application_master,start_it_old,4}]}}" > type: permanent > Eshell V5.4.5 (abort with ^G) > (cmmc@REDACTED)1> {"Kernel pid terminated",application_controller,shutdown} > > Crash dump was written to: erl_crash.dump > Kernel pid terminated (application_controller) (shutdown) > > > > > I just cannot figure out what's wrong here. > > I I have no idea how to interpret the erl_crash.dump > > Any help is most > welcome > > > > regards > > > Dietmar > From tpatro@REDACTED Mon Jun 27 07:44:46 2005 From: tpatro@REDACTED (Tamas Patrovics) Date: Mon, 27 Jun 2005 07:44:46 +0200 Subject: ESense 1.5 released In-Reply-To: References: Message-ID: Changes https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=337940 Files https://sourceforge.net/projects/esense/ Homepage http://esense.sourceforge.net/ From luvishsatija@REDACTED Mon Jun 27 07:44:18 2005 From: luvishsatija@REDACTED (luvish satija) Date: Mon, 27 Jun 2005 06:44:18 +0100 (BST) Subject: Mnesia Overloading Problem (contd.) Message-ID: <20050627054418.82155.qmail@web8508.mail.in.yahoo.com> Hello all, I told about the Mnesia Overloading problem in my previous mail. I would like to clarify the problem a bit more. My server process is creating four mnesia tables on the same node on which it is running. For every new client, server spawns a new process which then independently communicates with the mnesia tables. Now the problem is that when the number of clients crosses a certain limit ( approx. 10000), the following errors are thrown by the erlang shell: =ERROR REPORT==== 24-Jun-2005::10:48:31 === Error in process <0.3550.0> on node 'server@REDACTED' with exit value: {{badmatch,{aborted,{system_limit,"Cannot create an ets table for the local transaction store",{system_limit,[{ets,new,[mnesia_trans_store,[bag,public]]},{mnesia_tm,doit_loop,1},{mnesia_sp,init_proc,4},{proc_lib,... =ERROR REPORT==== 24-Jun-2005::10:48:35 === ** Too many db tables ** =ERROR REPORT==== 24-Jun-2005::10:48:50 === Mnesia(server@REDACTED): ** WARNING ** Mnesia is overloaded: {mnesia_tm, message_queue_len, [3156,3105]} Now I have certain doubts: 1. When I am creating only 4 tables, then how come "too many db tables" error is thrown? 2. To solve the problem at my level, I made some changes in the program. Now instead of all the processes simultaneously jumping on mnesia, there is only one process responsible for the transaction with mnesia. All the client processes contact that process. To my surprise this solution worked, and I could safely reach a limit of 10000. To check mnesia's status, the following was the output of ets:i(). id name type size mem owner ---------------------------------------------------------------------------- 8 cookies set 0 276 auth 10 code set 288 13790 code_server 11 code_names set 35 3440 code_server 15 dets duplicate_bag 0 276 dets 22 mnesia_subscr duplicate_bag 1 286 mnesia_subscr 23 mnesia_transient_decision set 0 276 mnesia_recover 29 mnesia_transient_decision set 0 276 mnesia_recover 30 mnesia_transient_decision set 20150 305597 mnesia_recover ac_tab ac_tab set 9 1029 application_controller client_buddylist client_buddylist set 0 276 mnesia_monitor client_offlinemessages client_offlinemessages set 0 276 mnesia_monitor client_online client_online set 10000 209599 mnesia_monitor client_profile client_profile set 10000 287387 mnesia_monitor dets_owners dets_owners set 0 276 dets dets_registry dets_registry set 0 276 dets disk_log_names disk_log_names set 1 286 disk_log_server disk_log_pids disk_log_pids set 1 286 disk_log_server global_locks global_locks set 0 276 global_name_server global_names global_names set 1 290 global_name_server global_names_ext global_names_ext set 0 276 global_name_server inet_cache inet_cache bag 0 276 inet_db inet_db inet_db set 20 556 inet_db inet_hosts inet_hosts set 8 700 inet_db mnesia_decision mnesia_decision set 1 287 mnesia_recover mnesia_gvar mnesia_gvar set 199 4008 mnesia_monitor mnesia_held_locks mnesia_held_locks bag 0 276 mnesia_monitor mnesia_lock_counter mnesia_lock_counter set 0 276 mnesia_monitor mnesia_lock_queue mnesia_lock_queue bag 0 276 mnesia_monitor mnesia_sticky_locks mnesia_sticky_locks set 0 276 mnesia_monitor mnesia_tid_locks mnesia_tid_locks bag 0 276 mnesia_monitor pg2_table pg2_table set 0 276 pg2 schema schema set 5 834 mnesia_monitor sys_dist sys_dist set 1 316 net_kernel 3. So, the result which I have drawn is that Mnesia was getting overloaded because of so many processes contending for transaction. AM I THINKING IN RIGHT DIRECTION or is there anything which is beyond this? 4. Why the entry mnesia_transient_decision having id 30 is having such a large size and taking large memory (nearly double of my tables's size. Tables created by my process are client_buddylist, client_offlinemessages, client_online, client_profile)? I tried googling before posing my questions but it didn't help me much. So, Please forgive me for if my doubts are very basic or any person out there is getting bored after reading this large mail, but the answers to these doubts will help me to go a long way in my project. Thanks in anticipation, /luvish _______________________________________________________ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com From dgud@REDACTED Mon Jun 27 08:45:29 2005 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 27 Jun 2005 08:45:29 +0200 Subject: Mnesia Overloading Problem (contd.) In-Reply-To: <20050627054418.82155.qmail@web8508.mail.in.yahoo.com> References: <20050627054418.82155.qmail@web8508.mail.in.yahoo.com> Message-ID: <17087.41097.187430.900962@rian.du.uab.ericsson.se> luvish satija writes: > Hello all, > > =ERROR REPORT==== 24-Jun-2005::10:48:50 === > Mnesia(server@REDACTED): ** WARNING ** Mnesia is > overloaded: {mnesia_tm, message_queue_len, > [3156,3105]} > > > Now I have certain doubts: > 1. When I am creating only 4 tables, then how come > "too many db tables" error is thrown? Each transaction uses ONE ets table to store everthing before data i commited. > > 2. To solve the problem at my level, I made some > changes in the program. Now instead of all the > processes simultaneously jumping on mnesia, there is > only one process responsible for the transaction with > mnesia. All the client processes contact that process. > To my surprise this solution worked, and I could > safely reach a limit of 10000. To check mnesia's > status, the following was the output of ets:i(). Then you have syncronized everything, if you do that you don't have to use transactions at all. Since no transactions will run in parallell you can change it to use mnesia:async_dirty(Fun) instead of mnesia:transaction(Fun) to reduce the transaction overhead. But if you want to add more machines in to your cluster it isn't a good solution. Or if you can slow down/reduce your no clients in some other way, so that mnesia can have the resources it needs, i.e. a limit to 10000 clients per machine, or atleast 10000 active transactions per machine. (or whatever your ERL MAX ETS TABLES is set to). Overload control is tricky that why mnesia leaves it to the user :-) > 3. So, the result which I have drawn is that Mnesia > was getting overloaded because of so many processes > contending for transaction. AM I THINKING IN RIGHT > DIRECTION or is there anything which is beyond this? Yes, actually it is to many simultanous transactions. > 4. Why the entry mnesia_transient_decision having id > 30 is having such a large size and taking large memory > (nearly double of my tables's size. Tables created by > my process are client_buddylist, > client_offlinemessages, client_online, > client_profile)? Thats a cache of the commit results, it should be ok. You have commited a lot of transactions.. > > Thanks in anticipation, > /luvish > From peppe@REDACTED Mon Jun 27 09:38:39 2005 From: peppe@REDACTED (UAB L/K Peter Andersson) Date: Mon, 27 Jun 2005 09:38:39 +0200 Subject: inets crashing in R10B-6 References: <42BC843E.5070405@hq.idt.net> <42BC8B1D.9040007@hq.idt.net> Message-ID: <42BFACFF.7CAAF8A4@erix.ericsson.se> Hi Serge, Yes, we've made some updates in both kernel and inets with regards to IPv6 handling. We had a resolver problem that could cause inets to believe IPv6 was working properly when, in fact, there was no support for IPv6 on the host. The behaviour you get when starting inets looks bad. inets is supposed to be able to fall back to IPv4 if IPv6 is not working properly. For some reason, the fix we made seems to rather have introduced the problem on your system. Weird. We'll have to look into this promptly! What OS are you using? Best regards, Peppe ----------------------- Erlang/OTP, Ericsson AB ----------------------- Serge Aleynikov wrote: > > I set up a trace on gen_tcp:listen, and see that httpd is trying to bind > to inet6, which is indeed the root of this problem on this host: > > 5> dbg:tracer(). > {ok,<0.47.0>} > 6> dbg:p(all,call). > {ok,[{matched,nonode@REDACTED,25}]} > 7> dbg:tpl(httpd_transport, listen, dbg:fun2ms(fun(_) -> return_trace() > end)). > {ok,[{matched,nonode@REDACTED,0},{saved,1}]} > 8> dbg:tpl(gen_tcp, listen, dbg:fun2ms(fun(_) -> return_trace() end)). > > {ok,[{matched,nonode@REDACTED,1},{saved,1}]} > 9> httpd:start_link(["../priv/inets.conf"]). > (<0.59.0>) call > gen_tcp:listen(8080,[inet6,{ip,any},{packet,0},{active,false},{backlog,128},{reuseaddr,true}]) > (<0.59.0>) returned from gen_tcp:listen/2 -> {error,eafnosupport} > ** exited: shutdown ** > > How can I force httpd not to use inet6? Did some default setting change > in R10B-6? I see this statement in the release notes, but not sure if > it is related: > > OTP-5576 When doing an inet6 name lookup on an IPv4 address it was > possible to get an address on IPv4 format back. This has been > corrected. Some other minor inconsistencies regarding IPv6 > name lookup have also been corrected. > > Thanks, > > Serge > > Serge Aleynikov wrote: > > Hi, > > > > I upgraded Erlang to R10B-6 and for some reason inets keeps crashing at > > startup. Before upgrading it worked under R10B-5 with no problems. > > > > >erl > > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] > > > > Eshell V5.4.8 (abort with ^G) > > 1>httpd:start_link(["../priv/inets.conf"]). > > > > =SUPERVISOR REPORT==== 24-Jun-2005::17:58:36 === > > Supervisor: {local,httpd_instance_sup_8080} > > Context: start_error > > Reason: {{listen,eafnosupport}, > > {child,undefined, > > {httpd_acceptor,any,8080}, > > {httpd_acceptor, > > start_link, > > [<0.66.0>, > > ip_comm, > > any, > > 8080, > > httpd_conf_8080, > > silence]}, > > permanent, > > 1000, > > worker, > > [httpd_acceptor]}} > > ... > > > > Here is the content of "../priv/inets.conf": > > ------BEGIN--------- > > BindAddress * > > Port 8080 > > ServerName wwwproxy > > > > ServerRoot ../priv > > DocumentRoot ../priv/docroot > > Modules mod_alias mod_auth mod_actions mod_include mod_dir > > mod_get mod_head > > > > DirectoryIndex index.html > > > > ErlScriptAlias /erl io io_lib server_mgr > > ------END--------- > > > > Any idea how to configure it in order to avoid this > > {listen,eafnosupport} "address family not supported by protocol family" > > error? > > > > Serge > > > > -- > Serge Aleynikov > R&D Telecom, IDT Corp. > Tel: (973) 438-3436 > Fax: (973) 438-1464 > serge@REDACTED From rprice@REDACTED Mon Jun 27 11:38:00 2005 From: rprice@REDACTED (Roger Price) Date: Mon, 27 Jun 2005 11:38:00 +0200 (CEST) Subject: Licensing of documentation Message-ID: I'm looking for "free as in freedom" documentation on Erlang to use as a starting point for a project. I'm assuming that Prentice Hall still has the copyright to "Concurrent Programming in Erlang - Part 1". Is this true ? What is the copyright status of the Erlang 4.7.3 Reference Manual dated Feb 9th, 1999 ? The introduction says it "should be useful as a basis for a future international standardization" which hints at openess, but I cannot find any copyright statement. Roger From ft@REDACTED Mon Jun 27 11:47:22 2005 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 27 Jun 2005 11:47:22 +0200 Subject: how to get Mnesia table size on secondary node Message-ID: <200506271147.22568.ft@it.su.se> Hi I'm trying to make Mnesia problems in my Erlang nodes detectable by our monitoring system. To do this, I thought that I would start by simply making each node report on the availability of the table 'phone' and the number of entries in it. On my primary node, this works just fine (there are two entrys in the table 'phone') : (incomingproxy@REDACTED)4> mnesia:table_info(phone, size). 2 but on the secondary (which can also see the two entrys in 'phone', I've checked that ;) ) mnesia:table_info(phone, size) returns 0. Inspection of the code mnesia:raw_table_info/2 made me check what storage_type was, and on the primary node it is 'disc_copies' but on the secondary node it is 'unknown', which makes mnesia:bad_info_reply/2 return zero. Is 'storage_type' supposed to be 'unknown' on secondary nodes or is my schema broken? Both nodes are running R10B-6. /Fredrik From dgud@REDACTED Mon Jun 27 11:53:49 2005 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 27 Jun 2005 11:53:49 +0200 Subject: Mnesia question In-Reply-To: <17074.25658.264015.490063@rian.du.uab.ericsson.se> References: <23967.194.2.91.222.1118936985.fusewebmail-66260@webmail.fusemail.com> <17074.25658.264015.490063@rian.du.uab.ericsson.se> Message-ID: <17087.52397.731290.813465@rian.du.uab.ericsson.se> Thanks, for sending error report and the files.. The problem is when you have created an index on disc_only_copies tables, and that info is still in the log when mnesia starts up. (which could be seen when using mnesia:set_debug_level(debug)). Patch mnesia_dumper: rian:src> diff -u mnesia_dumper.erl mnesia_dumper.erl@@/mnesia_4.2.2 --- mnesia_dumper.erl Mon Jun 27 11:36:47 2005 +++ mnesia_dumper.erl@@/mnesia_4.2.2 Wed Jan 26 12:02:50 2005 @@ -760,7 +760,6 @@ Storage = mnesia_lib:cs_to_storage_type(node(), Cs), case InitBy of startup when Storage == disc_only_copies -> - true = open_files(Tab, Storage, InPlace, InitBy), mnesia_index:init_indecies(Tab, Storage, [Pos]); startup -> ignore; /Dan Dan Gudmundsson writes: > > Hi > > That doesn't sound good, can you email me your test, and I'll have a look > at it. > > /Dan > > Mickael Remond writes: > > Hello, > > > > I have encountered potentially strange behaviour with Mnesia, when the > > changes applied to the database where made in a script-like fashion in a > > short-lived program. > > > > I had a program that was starting the database, then was inserting a > > record in the database and last was stopping mnesia and the Erlang VM with > > init:stop(). > > > > My record where not found in the database after a restart of the VM and > > Mnesia. It where correctly written by my script however (I put a read and > > print instruction to check). > > > > I found that the record was in the log file in the database directory, but > > was not replayed by Mnesia when restarted. > > I thought that it might have to do with log threshold options (Dump log is > > not triggered as the size of the transaction or the max time before dump > > is not reached). > > > > Finally adding a mnesia:dump_log instruction before stopping Mnesia in my > > short lived script solve the problem. > > > > I was wondering if this was the expected behaviour. I would have guessed > > that Mnesia should have read the log on startup or that shutdown would > > have dump the log. > > > > I was using Erlang/OTP R10B-3. > > > > Thank you for your feedback > > > > -- > > Micka?l R?mond -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From ft@REDACTED Mon Jun 27 12:03:57 2005 From: ft@REDACTED (Fredrik Thulin) Date: Mon, 27 Jun 2005 12:03:57 +0200 Subject: how to get Mnesia table size on secondary node In-Reply-To: <17087.52663.299573.720371@rian.du.uab.ericsson.se> References: <200506271147.22568.ft@it.su.se> <17087.52663.299573.720371@rian.du.uab.ericsson.se> Message-ID: <200506271203.57563.ft@it.su.se> On Monday 27 June 2005 11.58, Dan Gudmundsson wrote: ... > > mnesia:bad_info_reply/2 return zero. Is 'storage_type' supposed to > > be 'unknown' on secondary nodes or is my schema broken? > > Storage type is unknown on nodes without actual copies of the table, > or until the table is loaded locally on that node, if it supposed to > have a copy. > > The table size only returns something useful on tables which resides > locally, otherwise the size is 0 on that node.. Thank you, that explains it. So my schema was kind of broken since I _thought_ I had ram copies on my secondary node ;) By the way, impressive response time too. /Fredrik From mickael.remond@REDACTED Mon Jun 27 12:18:22 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Mon, 27 Jun 2005 12:18:22 +0200 Subject: Mnesia question In-Reply-To: <17087.52397.731290.813465@rian.du.uab.ericsson.se> References: <23967.194.2.91.222.1118936985.fusewebmail-66260@webmail.fusemail.com> <17074.25658.264015.490063@rian.du.uab.ericsson.se> <17087.52397.731290.813465@rian.du.uab.ericsson.se> Message-ID: <42BFD26E.2060203@erlang-fr.org> Dan Gudmundsson wrote: > Thanks, for sending error report and the files.. > > The problem is when you have created an index on disc_only_copies tables, > and that info is still in the log when mnesia starts up. > (which could be seen when using mnesia:set_debug_level(debug)). That's amazing to see what you are able to find from a simple Mnesia database directory, with no code provided :-) Thank you very much ! -- Micka?l R?mond From richardc@REDACTED Mon Jun 27 12:45:10 2005 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 27 Jun 2005 12:45:10 +0200 Subject: erl_prettypr In-Reply-To: <42BC206B.5040607@ericsson.com> References: <42BC206B.5040607@ericsson.com> Message-ID: <42BFD8B6.80107@csd.uu.se> Mats Cronqvist wrote: > i'm trying to make a erl-html filter using syntax-tools (works so-so), > but i've found this annoying behaviour. if i have this in a file (named > tst.erl); > > foo(Bla,X)->%hello > Bla. > > running this beauty; > > F="tst.erl",erl_prettypr:format(erl_recomment:recomment_forms(element(2,epp_dodger:parse_file(F)),erl_comment_scan:file(F))). > > > will give this; > > "foo(Bla,\n X) ->%hello\n Bla. > > there shouldn't be a line break between Bla and X. and indeed, if the > comment is removed there isn't. > anybody got any advice? It's been a while since I wrote that stuff, so I had to try it out to see why this happens. Although it might certainly be irritating, it's not without logic (and I don't know if it can be fixed). The comment is attached to the nearest construct in the parse tree, in this case the variable 'X' (and not the function clause). Then, the formatting will not like that an element in a parameter list has an attached comment (because comments must end with a line break), and will lay out the sequence vertically. (After that, the comment will be moved outside the ")->" part, but that is by another mechanism.) Consider this slight modification, and you might see that your example is just a special case: foo(Bla, X, %hello Bleh)-> Bla. Of course, that doesn't make it less irritating, but now you know what is causing it. Feel free to try to solve the problem. And welcome to the wonderful world of layout engines. /Richard From serge@REDACTED Mon Jun 27 13:23:50 2005 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 27 Jun 2005 07:23:50 -0400 Subject: inets crashing in R10B-6 In-Reply-To: <42BFACFF.7CAAF8A4@erix.ericsson.se> References: <42BC843E.5070405@hq.idt.net> <42BC8B1D.9040007@hq.idt.net> <42BFACFF.7CAAF8A4@erix.ericsson.se> Message-ID: <42BFE1C6.40403@hq.idt.net> >cat /proc/version Linux version 2.4.20 (root@REDACTED) (gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)) #2 SMP Wed Jan 29 18:40:47 EST 2003 Regards, Serge UAB L/K Peter Andersson wrote: > Hi Serge, > > Yes, we've made some updates in both kernel and inets with regards to > IPv6 handling. We had a resolver problem that could cause inets to > believe IPv6 was working properly when, in fact, there was no support > for IPv6 on the host. > > The behaviour you get when starting inets looks bad. inets is supposed > to be able to fall back to IPv4 if IPv6 is not working properly. For > some reason, the fix we made seems to rather have introduced the problem > on your system. Weird. We'll have to look into this promptly! > > What OS are you using? > > Best regards, > Peppe > > ----------------------- > Erlang/OTP, Ericsson AB > ----------------------- > > Serge Aleynikov wrote: > >>I set up a trace on gen_tcp:listen, and see that httpd is trying to bind >>to inet6, which is indeed the root of this problem on this host: >> >>5> dbg:tracer(). >>{ok,<0.47.0>} >>6> dbg:p(all,call). >>{ok,[{matched,nonode@REDACTED,25}]} >>7> dbg:tpl(httpd_transport, listen, dbg:fun2ms(fun(_) -> return_trace() >>end)). >>{ok,[{matched,nonode@REDACTED,0},{saved,1}]} >>8> dbg:tpl(gen_tcp, listen, dbg:fun2ms(fun(_) -> return_trace() end)). >> >>{ok,[{matched,nonode@REDACTED,1},{saved,1}]} >>9> httpd:start_link(["../priv/inets.conf"]). >>(<0.59.0>) call >>gen_tcp:listen(8080,[inet6,{ip,any},{packet,0},{active,false},{backlog,128},{reuseaddr,true}]) >>(<0.59.0>) returned from gen_tcp:listen/2 -> {error,eafnosupport} >>** exited: shutdown ** >> >>How can I force httpd not to use inet6? Did some default setting change >>in R10B-6? I see this statement in the release notes, but not sure if >>it is related: >> >> OTP-5576 When doing an inet6 name lookup on an IPv4 address it was >> possible to get an address on IPv4 format back. This has been >> corrected. Some other minor inconsistencies regarding IPv6 >> name lookup have also been corrected. >> >>Thanks, >> >>Serge >> >>Serge Aleynikov wrote: >> >>>Hi, >>> >>>I upgraded Erlang to R10B-6 and for some reason inets keeps crashing at >>>startup. Before upgrading it worked under R10B-5 with no problems. >>> >>> >erl >>>Erlang (BEAM) emulator version 5.4.8 [source] [hipe] [threads:0] >>> >>>Eshell V5.4.8 (abort with ^G) >>>1>httpd:start_link(["../priv/inets.conf"]). >>> >>>=SUPERVISOR REPORT==== 24-Jun-2005::17:58:36 === >>> Supervisor: {local,httpd_instance_sup_8080} >>> Context: start_error >>> Reason: {{listen,eafnosupport}, >>> {child,undefined, >>> {httpd_acceptor,any,8080}, >>> {httpd_acceptor, >>> start_link, >>> [<0.66.0>, >>> ip_comm, >>> any, >>> 8080, >>> httpd_conf_8080, >>> silence]}, >>> permanent, >>> 1000, >>> worker, >>> [httpd_acceptor]}} >>>... >>> >>>Here is the content of "../priv/inets.conf": >>>------BEGIN--------- >>>BindAddress * >>>Port 8080 >>>ServerName wwwproxy >>> >>>ServerRoot ../priv >>>DocumentRoot ../priv/docroot >>>Modules mod_alias mod_auth mod_actions mod_include mod_dir >>>mod_get mod_head >>> >>>DirectoryIndex index.html >>> >>>ErlScriptAlias /erl io io_lib server_mgr >>>------END--------- >>> >>>Any idea how to configure it in order to avoid this >>>{listen,eafnosupport} "address family not supported by protocol family" >>>error? >>> >>>Serge >>> >> >>-- >>Serge Aleynikov >>R&D Telecom, IDT Corp. >>Tel: (973) 438-3436 >>Fax: (973) 438-1464 >>serge@REDACTED > > From gunilla@REDACTED Mon Jun 27 13:55:12 2005 From: gunilla@REDACTED (Gunilla Arendt) Date: Mon, 27 Jun 2005 13:55:12 +0200 Subject: Fwd: bug in docs or in ets:info/1? In-Reply-To: <200506201038.01728.ft@it.su.se> References: <200506201038.01728.ft@it.su.se> Message-ID: <42BFE920.207@erix.ericsson.se> Hi, The documentation for ets has now been updated, saying that ets:info/1 returns a tuple. Best regards, Gunilla Fredrik Thulin wrote: > Hi > > When googling for something unrelated, I stumbled upon an old post of > mine that I did not remember ever getting an answer for, and the > problem (if it is a problem) is still there in R10B-5, so I though I'd > bring it up again. > > It seems really odd to me that ets:info/1 returns a tuple containing > tuples instead of a list of tuples, like the documentation says it > should. Is this a bug in the documentation or in the code? > > /Fredrik > > > ---------- Forwarded Message ---------- > > Subject: bug in docs or in ets:info/1? > Date: Tuesday 02 November 2004 07.35 > From: Fredrik Thulin > To: erlang-questions@REDACTED > > Hi > > It seems to me that the documentation of ets:info/1 isn't in sync with > the code, or even more probably the other way around. The R10B-0 > documentation says that ets:info/1 returns a list of tuples, when it is > in fact returning a tuple containing a number of tuples. I think a list > of tuples would be more suitable. > > Eshell V5.4 (abort with ^G) > 1> L = ets:info(inet_cache). > {{memory,277}, > ... > {protection,public}} > 2> is_list(L). > false > 3> is_tuple(L). > true > 4> > > Documentation : > >>info(Tab) -> [{Item,Value}] | undefined >> >>Types: >> >>Tab = tid() | atom() >>Item, Value - see below >> >>Returns information about the table Tab as a list of {Item,Value} >>tuples: > > > The fix in ets.erl seems pretty obvious, but maybe there are concerns > with code that is expecting the current format? > > /Fredrik > > ------------------------------------------------------- > > -- _____Gunilla Arendt______________________________________________ Erlang/OTP development Gunilla.Arendt@REDACTED +46-8-7275730 ecn 851 5730 From sean.hinde@REDACTED Mon Jun 27 15:07:22 2005 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 27 Jun 2005 14:07:22 +0100 Subject: bug in docs or in ets:info/1? In-Reply-To: <42BFE920.207@erix.ericsson.se> References: <200506201038.01728.ft@it.su.se> <42BFE920.207@erix.ericsson.se> Message-ID: <8F9716C5-42A6-4BA6-9860-0F90A0FDC585@mac.com> Hi, Presumably this decision was taken in the interests of backwards compatibility. It seems a shame to keep such a non intuitive/non erlang solution when even the documentation described a more sensible behaviour. A better way forward might be to wait until the next major erlang release, fix the bug, and place a short note in the backward compatibility section of the release notes to say that this function is fixed and now produces what is documented. Anyone updating to R11 will have to deal with other such issues and it does seem such a shame to keep broken behaviour with no potential for a fix. Sean On 27 Jun 2005, at 12:55, Gunilla Arendt wrote: > Hi, > > The documentation for ets has now been updated, saying that > ets:info/1 returns a tuple. > > Best regards, Gunilla > > Fredrik Thulin wrote: > >> Hi >> When googling for something unrelated, I stumbled upon an old post >> of mine that I did not remember ever getting an answer for, and >> the problem (if it is a problem) is still there in R10B-5, so I >> though I'd bring it up again. >> It seems really odd to me that ets:info/1 returns a tuple >> containing tuples instead of a list of tuples, like the >> documentation says it should. Is this a bug in the documentation >> or in the code? >> /Fredrik >> ---------- Forwarded Message ---------- >> Subject: bug in docs or in ets:info/1? >> Date: Tuesday 02 November 2004 07.35 >> From: Fredrik Thulin >> To: erlang-questions@REDACTED >> Hi >> It seems to me that the documentation of ets:info/1 isn't in sync >> with >> the code, or even more probably the other way around. The R10B-0 >> documentation says that ets:info/1 returns a list of tuples, when >> it is >> in fact returning a tuple containing a number of tuples. I think a >> list >> of tuples would be more suitable. >> Eshell V5.4 (abort with ^G) >> 1> L = ets:info(inet_cache). >> {{memory,277}, >> ... >> {protection,public}} >> 2> is_list(L). >> false >> 3> is_tuple(L). >> true >> 4> >> Documentation : >> >>> info(Tab) -> [{Item,Value}] | undefined >>> >>> Types: >>> >>> Tab = tid() | atom() >>> Item, Value - see below >>> >>> Returns information about the table Tab as a list of {Item,Value} >>> tuples: >>> >> The fix in ets.erl seems pretty obvious, but maybe there are concerns >> with code that is expecting the current format? >> /Fredrik >> ------------------------------------------------------- >> > > > -- > _____Gunilla Arendt______________________________________________ > Erlang/OTP development > Gunilla.Arendt@REDACTED +46-8-7275730 ecn 851 5730 > From gunilla@REDACTED Mon Jun 27 16:19:35 2005 From: gunilla@REDACTED (Gunilla Arendt) Date: Mon, 27 Jun 2005 16:19:35 +0200 Subject: bug in docs or in ets:info/1? In-Reply-To: <8F9716C5-42A6-4BA6-9860-0F90A0FDC585@mac.com> References: <200506201038.01728.ft@it.su.se> <42BFE920.207@erix.ericsson.se> <8F9716C5-42A6-4BA6-9860-0F90A0FDC585@mac.com> Message-ID: <42C00AF7.4050103@erix.ericsson.se> Hi Sean, I agree completely and -- unless there is a really really good argument against it -- we will fix the return value in R11B. Best regards, Gunilla Sean Hinde wrote: > Hi, > > Presumably this decision was taken in the interests of backwards > compatibility. > > It seems a shame to keep such a non intuitive/non erlang solution when > even the documentation described a more sensible behaviour. > > A better way forward might be to wait until the next major erlang > release, fix the bug, and place a short note in the backward > compatibility section of the release notes to say that this function is > fixed and now produces what is documented. > > Anyone updating to R11 will have to deal with other such issues and it > does seem such a shame to keep broken behaviour with no potential for a > fix. > > Sean > > > On 27 Jun 2005, at 12:55, Gunilla Arendt wrote: > >> Hi, >> >> The documentation for ets has now been updated, saying that >> ets:info/1 returns a tuple. >> >> Best regards, Gunilla >> >> Fredrik Thulin wrote: >> >>> Hi >>> When googling for something unrelated, I stumbled upon an old post >>> of mine that I did not remember ever getting an answer for, and the >>> problem (if it is a problem) is still there in R10B-5, so I though >>> I'd bring it up again. >>> It seems really odd to me that ets:info/1 returns a tuple containing >>> tuples instead of a list of tuples, like the documentation says it >>> should. Is this a bug in the documentation or in the code? >>> /Fredrik >>> ---------- Forwarded Message ---------- >>> Subject: bug in docs or in ets:info/1? >>> Date: Tuesday 02 November 2004 07.35 >>> From: Fredrik Thulin >>> To: erlang-questions@REDACTED >>> Hi >>> It seems to me that the documentation of ets:info/1 isn't in sync with >>> the code, or even more probably the other way around. The R10B-0 >>> documentation says that ets:info/1 returns a list of tuples, when it is >>> in fact returning a tuple containing a number of tuples. I think a list >>> of tuples would be more suitable. >>> Eshell V5.4 (abort with ^G) >>> 1> L = ets:info(inet_cache). >>> {{memory,277}, >>> ... >>> {protection,public}} >>> 2> is_list(L). >>> false >>> 3> is_tuple(L). >>> true >>> 4> >>> Documentation : >>> >>>> info(Tab) -> [{Item,Value}] | undefined >>>> >>>> Types: >>>> >>>> Tab = tid() | atom() >>>> Item, Value - see below >>>> >>>> Returns information about the table Tab as a list of {Item,Value} >>>> tuples: >>>> >>> The fix in ets.erl seems pretty obvious, but maybe there are concerns >>> with code that is expecting the current format? >>> /Fredrik >>> ------------------------------------------------------- >>> >> >> >> -- >> _____Gunilla Arendt______________________________________________ >> Erlang/OTP development >> Gunilla.Arendt@REDACTED +46-8-7275730 ecn 851 5730 >> > > From ulf.wiger@REDACTED Mon Jun 27 17:25:53 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 27 Jun 2005 17:25:53 +0200 Subject: erl_prettypr Message-ID: I wrote my own layout engine, but cheated - and let the token scanner return column numbers rather than just line numbers. The "layout engine" then laid things out exactly as written. In order to preserve comments, I made the token scanner save comments as well. The tricky part was knowing how to pass them along without messing up the parser. I finally settled on the perhaps inelegant strategy of making every other element in the list of tokens a "comment or whitespace" list. Like so: 1> ccv_erl_scanner:file("ccv_stats.erl"). [[{comment,1, 1, 1, "%%% ----------------------------------------------------------"}, {comment,2,1,1,"%%%"}, {comment,3, 1, 1, "%%% The contents of this file are subject to the Erlang Public License,"}, ... {comment,19, 1, 1, "%%% Contributor(s): ______________________________________."}, {ws,20,1,1,"\n"}, {...}|...], {symbol,31,1,2,'-'}, [], {word,31,2,8,"module"}, []|...] One could of course use "annotated tokens" instead. Don't know what would be the most b/w incompatible change. Perhaps adding column numbers to the scanner would involve reasonable effort. /Uffe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED]On Behalf Of > Richard Carlsson > Sent: den 27 juni 2005 12:45 > To: Mats Cronqvist (AL/EAB); erlang-questions@REDACTED > Subject: Re: erl_prettypr > > > Mats Cronqvist wrote: > > i'm trying to make a erl-html filter using syntax-tools > (works so-so), > > but i've found this annoying behaviour. if i have this in a > file (named > > tst.erl); > > > > foo(Bla,X)->%hello > > Bla. > > > > running this beauty; > > > > > F="tst.erl",erl_prettypr:format(erl_recomment:recomment_forms( > element(2,epp_dodger:parse_file(F)),erl_comment_scan:file(F))). > > > > > > will give this; > > > > "foo(Bla,\n X) ->%hello\n Bla. > > > > there shouldn't be a line break between Bla and X. and > indeed, if the > > comment is removed there isn't. > > anybody got any advice? > > It's been a while since I wrote that stuff, so I had to try > it out to see why > this happens. Although it might certainly be irritating, it's > not without logic > (and I don't know if it can be fixed). The comment is > attached to the nearest > construct in the parse tree, in this case the variable 'X' > (and not the > function clause). Then, the formatting will not like that an > element in a > parameter list has an attached comment (because comments must > end with a line > break), and will lay out the sequence vertically. (After > that, the comment will > be moved outside the ")->" part, but that is by another mechanism.) > > Consider this slight modification, and you might see that > your example is > just a special case: > > foo(Bla, > X, %hello > Bleh)-> > Bla. > > Of course, that doesn't make it less irritating, but now you > know what is > causing it. Feel free to try to solve the problem. And > welcome to the wonderful > world of layout engines. > > /Richard > From bfulg@REDACTED Tue Jun 28 05:22:12 2005 From: bfulg@REDACTED (Brent Fulgham) Date: Mon, 27 Jun 2005 20:22:12 -0700 Subject: Licensing of documentation In-Reply-To: References: Message-ID: <1B66D240-BF4A-451B-829D-14A41CBEB2DE@pacbell.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I started a Wiki book (The Erlang Cookbook) at http:// schemecookbook.org/view/Erlang/WebHome, which you are welcome to use for a project of this sort. Unfortunately, my intentions were (as always) greater than my actual availability -- but I still add to it from time-to-time. - -Brent On Jun 27, 2005, at 2:38 AM, Roger Price wrote: > I'm looking for "free as in freedom" documentation on Erlang to use > as a > starting point for a project. > > I'm assuming that Prentice Hall still has the copyright to "Concurrent > Programming in Erlang - Part 1". Is this true ? > > What is the copyright status of the Erlang 4.7.3 Reference Manual > dated > Feb 9th, 1999 ? The introduction says it "should be useful as a > basis for > a future international standardization" which hints at openess, but I > cannot find any copyright statement. > > Roger > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFCwMJlzGDdrzfvUpURArz+AKCHaGfUllZcuxEkZZc+I58yzIn7vACfW24v x61uUVFXSfUDRhJQohaxy9I= =ZRIv -----END PGP SIGNATURE----- From joe.armstrong@REDACTED Tue Jun 28 09:13:11 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 28 Jun 2005 09:13:11 +0200 Subject: Licensing of documentation Message-ID: > I'm looking for "free as in freedom" documentation on Erlang > to use as a > starting point for a project. What does "free as in freedom" mean? free is an adjective and freedom a noun? > I'm assuming that Prentice Hall still has the copyright to "Concurrent > Programming in Erlang - Part 1". Is this true ? Yes. Prentice hall retain the copyright by they have allowed us to freely distribute part I of the book. > > What is the copyright status of the Erlang 4.7.3 Reference > Manual dated > Feb 9th, 1999 ? The introduction says it "should be useful > as a basis for > a future international standardization" which hints at openess, but I > cannot find any copyright statement. Following the Bern copyright convention virtually all material produced after 1 April 1989 is implicitly copyright whether or not it has a copyright notice. The copyright symbol and text merely strengthens the protection. The concepts of "openness" and "copyright" are not the same. Anyway what is interesting is what you can do with a document. If something has no explicit copyright and no license then: - the copyright is implicit - "fair use" applies ie you can quote from and comment on the text there is a lot written about fasir use elsewhere If something has an explicit license then this may or may not give you greater rights than the "fair use" rights implied by the copyright. As regards the Erlang reference manual the latest version is 5.4.8 and it has an explicit copyright. It should be part of the open source Erlang release and as such be covered by the Erlang public License. http://www.erlang.org/about.html Has some general blurb about the license status of Erlang and to the material you will find on the site. It is the intention that everything on the erlang.org web site is covered by the Erlang Public License - otherwise it would not be on the site Cheers /Joe From ulf.wiger@REDACTED Tue Jun 28 09:31:39 2005 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Tue, 28 Jun 2005 09:31:39 +0200 Subject: Licensing of documentation Message-ID: Joe Armstrong wrote: > What does "free as in freedom" mean? free is an adjective and > freedom a noun? As opposed to "free as in beer". ;-) http://www.fsf.org/licensing/essays/free-sw.html /Uffe From rprice@REDACTED Tue Jun 28 10:52:09 2005 From: rprice@REDACTED (Roger Price) Date: Tue, 28 Jun 2005 10:52:09 +0200 (CEST) Subject: Licensing of documentation In-Reply-To: Message-ID: On Tue, 28 Jun 2005, Joe Armstrong (AL/EAB) wrote: > > "Concurrent Programming in Erlang - Part 1". Is this true ? > Yes. Prentice hall retain the copyright by they have allowed > us to freely distribute part I of the book. > As regards the Erlang reference manual the latest version is 5.4.8 and it has an > explicit copyright. > > It should be part of the open source Erlang release and as such be covered by > the Erlang public License. > ... > It is the intention that everything on the erlang.org web site is covered by the > Erlang Public License - otherwise it would not be on the site Hello Joe, Thanks for the clarification. I was thinking about publishing a work derived from the distributed documentation, and licensed under GNU GPL http://www.gnu.org/copyleft/gpl.html or FDL http://www.gnu.org/copyleft/fdl.html; but I understand now that this is not possible. The Erlang Public License (derived from the Mozilla Public License) is incompatible with GNU GPL/FDL according to the Free Software Foundation http://www.gnu.org/philosophy/license-list.html#NonFreeSoftwareLicense Cheers, Roger From joe.armstrong@REDACTED Tue Jun 28 14:26:06 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 28 Jun 2005 14:26:06 +0200 Subject: Licensing of documentation Message-ID: > Hello Joe, Thanks for the clarification. I was thinking > about publishing > a work derived from the distributed documentation, and > licensed under GNU > GPL http://www.gnu.org/copyleft/gpl.html or FDL > http://www.gnu.org/copyleft/fdl.html; but I understand now > that this is > not possible. This is not my reading of things - see below > > The Erlang Public License (derived from the Mozilla Public License) is > incompatible with GNU GPL/FDL according to the Free Software > Foundation > http://www.gnu.org/philosophy/license-list.html#NonFreeSoftwareLicense This is very strange to me. 1) The GNU site says that the Mozilla Public Licence is a free license 2) The Erlang public license was derived from the Mozilla license - the intention was to be less restrictive than the Mozilla License. We actually want you to take things in the open source distribution improve them and distribute them to other people: The license says this: --- quote --- 2.2. Contributor Grant. Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and --- end -- NB " use, reproduce, modify, ... and distribute the modifications ... as part of a larger work pretty clear to me .... and --- quote --- 3.2. Availability of Source Code. Any Modification which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; --- end --- NB " Any modifications which you contribute must be made available ... " Rather like the GNU copyleft So "publishing a work derived from the distributed doumentation" is fine but "publishing a work derived from the distributed documentation licensed under the GNU license" is not since any modifications must include the original license. Since the Erlang license is not restrictive in any way this seems rather strange. Finally point 10. of the Erlang license: ... shall be subject to the exclusive jurisdiction of Swedish courts, with the Stockholm City Court as the first instance. Now Sweden is not a litigious country, lawyers do not tout for business here, and damages when awarded are by international standards extremely low. Punatative damages and class action cases are almost unheard of. The reason why Ericsson released Erlang as Open source was to encourage the spread of the language. The reason why we re-wrote the Mozilla license was to give you more freedoms than the mozilla license, and the mozilla license itself is viewed as being a free license by the GNU organisation. My suggestion would be to do what you propose and publish according to the Erlang license. The important thing is contribute new material which can be of benefit to other people and not the legal text at the beginning of a document which nobody reads anyway. Cheers /Joe From rprice@REDACTED Tue Jun 28 18:13:40 2005 From: rprice@REDACTED (Roger Price) Date: Tue, 28 Jun 2005 18:13:40 +0200 (CEST) Subject: Licensing of documentation In-Reply-To: Message-ID: On Tue, 28 Jun 2005, Joe Armstrong (AL/EAB) wrote: > > The Erlang Public License (derived from the Mozilla Public License) is > > incompatible with GNU GPL/FDL according to the Free Software > > Foundation > > http://www.gnu.org/philosophy/license-list.html#NonFreeSoftwareLicense > > This is very strange to me. > > 1) The GNU site says that the Mozilla Public Licence is a free license Free, but incompatible. Quoting fom the FSF's description of the Mozilla Public License (MPL): ? This is a free software license which is not a strong copyleft; unlike the X11 license, it has some complex restrictions that make it incompatible with the GNU GPL. That is, a module covered by the GPL and a module covered by the MPL cannot legally be linked together. We urge you not to use the MPL for this reason. ? I am not a lawyer, and I found this strong enough to discourage me. > 2) The Erlang public license was derived from the Mozilla license - > the intention was to be less restrictive than the Mozilla License. Perhaps the Erlang Public License (EPL) is sufficiently different to the MPL to make it compatible. It would be interesting to ask the FSF their "official" opinion about EPL-GPL compatibility. http://www.gnu.org/licenses/license-list.html#Introduction > My suggestion would be to do what you propose and publish according to > the Erlang license. The important thing is contribute new material which > can be of benefit to other people and not the legal text at the > beginning of a document which nobody reads anyway. Personally, I agree with you, but I worked for many years for a large organization which employs many lawyers, and which takes IP very seriously. I have not worked for them for over 10 years, but I still have to get their lawyers' approval to publish a program written in my own time on my own equipment. I am currently negotiating with them about a GPL licensed program - I have not yet told them about the EPL. Cheers Roger From ft@REDACTED Tue Jun 28 21:42:57 2005 From: ft@REDACTED (Fredrik Thulin) Date: Tue, 28 Jun 2005 21:42:57 +0200 Subject: bug in SSL-PKIX certificate parser Message-ID: <200506282142.57602.ft@it.su.se> Hi I've managed to create an invalid certificate that crashes Erlang when connecting to it. I was trying to create a certificate that was both a client and server, and ended up with a certificate that was neither ;). Anyways, here is how to make the bug manifest itself, using R10B-6. Feel free to connect to the port 5061 at 193.11.25.104 for testing purposes. I will leave the server with the invalid certificate there under my vacation, so if nothing happens to the server it should be there for a few weeks. $ /pkg/erlang/R10B-6/bin/erl Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) 1> application:start(ssl). ok 2> {ok, S} = ssl:connect("193.11.25.104", 5061, []). {ok,{sslsocket,4,<0.40.0>}} 3> ssl:peercert(S, [subject, ssl]). =ERROR REPORT==== 28-Jun-2005::21:37:25 === Error in process <0.30.0> with exit value: {{badmatch,{error,{asn1, {function_clause,[{'SSL-PKIX',getdec_SupportedExtensions,[id, {2,16,840,1,113730,1,4}]},{'SSL-PKIX',dec_Extension,2}, {'SSL-PKIX',decode,2},{ssl_pkix,transform,1},{lists,map,2}, {ssl_pkix,transform,1},{ssl_pkix,transform,... ** exited: {{badmatch,{error,{asn1,{function_clause, [{'SSL-PKIX', getdec_SupportedExtensions, [id, {2,16,840,1,113730,1,4}]}, {'SSL-PKIX',dec_Extension,2}, {'SSL-PKIX',decode,2}, {ssl_pkix,transform,1}, {lists,map,2}, {ssl_pkix,transform,1}, {ssl_pkix,transform,1}, {ssl_pkix,decode_cert,2}]}}}}, [{ssl_pkix,transform,1}, {lists,map,2}, {ssl_pkix,transform,1}, {ssl_pkix,transform,1}, {ssl_pkix,decode_cert,2}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** 4> /Fredrik From irmatov@REDACTED Wed Jun 29 08:31:25 2005 From: irmatov@REDACTED (Timur Irmatov) Date: Wed, 29 Jun 2005 11:31:25 +0500 Subject: erlang install problem on redhat Message-ID: <241d382f050628233161f25cd0@mail.gmail.com> Hi! Recently, I have tried to install Erlang on one of our Redhat servers.. Before that I have tried to compile Erlang on my ubuntu desktop, it succeeded. But on Redhat (redhat 9.0, kernel 2.4.20) machine I try to execute bin/erl to check that everything's ok and it dies with following: thor@REDACTED:/usr/local/src/otp_src_R10B-6$ bin/erl {error_logger,{{2005,6,29},{11,14,42}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{'DOWN',#Ref< 0.0.0.12 >,process,<0.15.0 >,normal}},{offender,[{pid,undefined},{name,code_server},{mfa,{code,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} {error_logger,{{2005,6,29},{11,14,42}},crash_report,[[{pid,<0.7.0 >},{registered_name,[]},{error_info,{shutdown,{kernel,start,[normal,[]]}}},{initial_call,{application_master,init,[< 0.5.0>,<0.6.0 >,{appl_data,kernel,[application_controller,erl_reply,auth,boot_server,code_server,disk_log_server,disk_log_sup,erl_prim_loader,error_logger,file_server,file_server_2,fixtable_server,global_group,global_name_server,heart,init,kernel_config,kernel_sup,net_kernel,net_sup,rex,user,os_server,ddll_server,erl_epmd,inet_db,pg2],undefined,{kernel,[]},[application,application_controller,application_master,application_starter,auth,code,code_aux,packages,code_server,dist_util,erl_boot_server,erl_distribution,erl_prim_loader,erl_reply,erlang,error_handler,error_logger,file,file_server,old_file_server,file_io_server,prim_file,global,global_group,global_search,group,heart,hipe_unified_loader,hipe_sparc_loader,hipe_ppc_loader,hipe_ppc64_loader,hipe_x86_loader,hipe_amd64_loader,inet6_tcp,inet6_tcp_dist,inet6_udp,inet_config,inet_hosts,inet_gethost_native,inet_tcp_dist,init,kernel,kernel_config,net,net_adm,net_kernel,os,ram_file,rpc,user,user_drv,user_sup,disk_log,disk_log_1,disk_log_server,disk_log_sup,dist_ac,erl_ddll,erl_epmd,erts_debug,gen_tcp,gen_udp,prim_inet,inet,inet_db,inet_dns,inet_parse,inet_res,inet_tcp,inet_udp,pg2,seq_trace,wrap_log_reader,zlib,otp_ring0],[],infinity,infinity},normal]}},{ancestors,[< 0.6.0>]},{messages,[{'EXIT',<0.8.0>,normal}]},{links,[<0.6.0>,<0.5.0 >]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,21},{reductions,1041}],[]]} {error_logger,{{2005,6,29},{11,14,42}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,shutdown} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) (shutdown) I am new to erlang and don't know where to look now to resolve the problem. Recently, the machine had some hardware issues (like segfaulting gcc while compiling differents apps or even kernel panics). But now the machine seems to run fine (compiles kernel several times with no errors), but I can't be completely sure. Any hints will be greatly appreciated. -- Sincerely yours, Timur Irmatov. JID: thor@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon@REDACTED Wed Jun 29 11:35:04 2005 From: simon@REDACTED (Simon Aurell) Date: Wed, 29 Jun 2005 10:35:04 +0100 Subject: Web interface framework for Erlang Message-ID: <000f01c57c8d$d4be4740$c800a8c0@Simon> Hello, We are currently looking into the idea of building a web framework for Erlang. I.e. a framework for good separation of presentation and domain/business logic, aimed at web interfaces. It would have features such as easy mapping of data entities to html objects, a nice api for common tasks such as handling form data and probably some handy utilities. A lightweight version of frameworks like WebObjects, I guess. Can anyone tell us what have been done in this area? I've been looking around in the Erlang repositories I know of but have found very little. I know of a couple of template engines, but that seems to be it. Are there any components or libraries that could be useful? Any help would be greatly appreciated. Cheers, Simon ---- Erlang Training and Consulting http://www.erlang-consulting.com From alex.arnon@REDACTED Wed Jun 29 12:00:16 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Wed, 29 Jun 2005 13:00:16 +0300 Subject: Erlang Micro Edition. Message-ID: <944da41d050629030019d5269d@mail.gmail.com> Hi All. I would like to hear your opinions on the usefulness of creating a small-footprint Erlang VM. Specifically, such a project might follow the J2ME approach, where the VM+basic libraries are cut down versions of the full environment, while retaining compatibility to code compiled using the standard tools. This would mean that while BEAM files should be loadable and linkable in runtime by the VM, fewer BIFs and a much smaller set of standard libraries would be supported relative to the standard ERL, and possibly less functionality out of the door (e.g. no distribution initially). Such a VM might also add some functionality, e.g. features for stricter resource management (this is meant for relatively small embedded systems). The basic aims of such a project: - To bring Erlang to the table of embedded software engineers (and as a generally embedded lightweight language/environment). The current standard Erlang implementation is neither lightweight nor portable enough for many projects. - The idea is to "give them a taste" of the full Erlang - while some enterprising devs would try something like Lua today (easy integration with C/C++, low resource consumption, level of abstraction, dynamic), Erlang should be a more attractive option for many problem domains. - To reduce the risk of same embedded/other devs. As I said above, Lua is often chosen because it is a small, lightweight environment, and it is easy for developers and project managers to try it out on a small scale before committing large parts of the project's high-level logic to it. In the case of systems which do not require a small-footprint VM, this will also give the developers a migration path to full-blown Erlang (which is where we want them, really :) ). Do you find this to be sound reasoning, or is the whole idea superfluous in your opinion? Cheers, Alex Arnon. From ke.han@REDACTED Wed Jun 29 12:26:17 2005 From: ke.han@REDACTED (ke.han) Date: Wed, 29 Jun 2005 18:26:17 +0800 Subject: Web interface framework for Erlang In-Reply-To: <000f01c57c8d$d4be4740$c800a8c0@Simon> References: <000f01c57c8d$d4be4740$c800a8c0@Simon> Message-ID: <42C27749.9000306@redstarling.com> I have just started experimenting with xforms. There is a pure Javascript browser implementation from http://www.formfaces.com/main.jsp. The formfaces examples in the latest download are very simple to use. It would be very nice if whatever you did used this as part of the solution. I may even be able to help. thanks, ke han Simon Aurell wrote: > Hello, > > We are currently looking into the idea of building a web framework for > Erlang. I.e. a framework for good separation of presentation and > domain/business logic, aimed at web interfaces. It would have features > such as easy mapping of data entities to html objects, a nice api for > common tasks such as handling form data and probably some handy > utilities. A lightweight version of frameworks like WebObjects, I guess. > > Can anyone tell us what have been done in this area? I've been looking > around in the Erlang repositories I know of but have found very little. > I know of a couple of template engines, but that seems to be it. Are > there any components or libraries that could be useful? Any help would > be greatly appreciated. > > > Cheers, > > Simon > > > ---- > Erlang Training and Consulting > http://www.erlang-consulting.com > > From alex.arnon@REDACTED Wed Jun 29 13:38:43 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Wed, 29 Jun 2005 14:38:43 +0300 Subject: Erlang Micro Edition. In-Reply-To: References: Message-ID: <944da41d050629043857e0a4e6@mail.gmail.com> Okay, maybe Not-So-Micro Edition, if ME == mote-sized :) I'm not talking about Erlang-in-64K, but rather devices with X MB, where 43MB VM (before code loading, after linkage with local libs). I claim (humbly, of course :) ) that project managers and team leaders for many products will never even _try_ Erlang due to either practical concerns (space, portability) or percieved risk. Give them "we can handle the overhead" and "hey, I just embedded this after changing just two #includes" (a-la Lua). On 6/29/05, Domonkos Asztalos (IJ/ETH) wrote: > Hi, > let's move on. > Do you think would it be realistic to try on a mote size node, used in sensor networks? > /Domonkos > > Domonkos Asztalos > Ericsson Hungary > > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] > Sent: Wednesday, June 29, 2005 12:00 PM > To: erlang-questions@REDACTED > Subject: Erlang Micro Edition. > > > Hi All. > > I would like to hear your opinions on the usefulness of creating a > small-footprint Erlang VM. Specifically, such a project might follow > the J2ME approach, where the VM+basic libraries are cut down versions > of the full environment, while retaining compatibility to code > compiled using the standard tools. This would mean that while BEAM > files should be loadable and linkable in runtime by the VM, fewer BIFs > and a much smaller set of standard libraries would be supported > relative to the standard ERL, and possibly less functionality out of > the door (e.g. no distribution initially). Such a VM might also add > some functionality, e.g. features for stricter resource management > (this is meant for relatively small embedded systems). > The basic aims of such a project: > - To bring Erlang to the table of embedded software engineers (and as > a generally embedded lightweight language/environment). The current > standard Erlang implementation is neither lightweight nor portable > enough for many projects. > - The idea is to "give them a taste" of the full Erlang - while some > enterprising devs would try something like Lua today (easy integration > with C/C++, low resource consumption, level of abstraction, dynamic), > Erlang should be a more attractive option for many problem domains. > - To reduce the risk of same embedded/other devs. As I said above, Lua > is often chosen because it is a small, lightweight environment, and it > is easy for developers and project managers to try it out on a small > scale before committing large parts of the project's high-level logic > to it. In the case of systems which do not require a small-footprint > VM, this will also give the developers a migration path to full-blown > Erlang (which is where we want them, really :) ). > > Do you find this to be sound reasoning, or is the whole idea > superfluous in your opinion? > > > Cheers, > Alex Arnon. > From joe.armstrong@REDACTED Wed Jun 29 16:47:53 2005 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Wed, 29 Jun 2005 16:47:53 +0200 Subject: Erlang Micro Edition. Message-ID: > > I would like to hear your opinions on the usefulness of creating a > small-footprint Erlang VM. Yes Please. BTW - does anybody have a copy of the first released JAM implementation? I have looked at all my old floppies but cannot find the thing. Dated about 1989. /Joe From chris@REDACTED Wed Jun 29 19:59:59 2005 From: chris@REDACTED (Christophe Romain) Date: Wed, 29 Jun 2005 19:59:59 +0200 Subject: Erlang Micro Edition. In-Reply-To: <944da41d050629030019d5269d@mail.gmail.com> References: <944da41d050629030019d5269d@mail.gmail.com> Message-ID: <99d5966624241a2a42559190235ddfac@erlang-fr.org> Hi This project sounds good to me. I tried to port Erlang to the Zaurus platform some times ago. I had a 6Mb working system with all library needed by my testing application. but is the Zaurus a real embedded system ? the actuel VM can be more lightweight, but I think a first step should be: 1) improve the actual build system to allow easy cross compilation 2) add a configuration stage with a dialog style script to choose: -> which library to include (manual library selection) -> which profile to choose (minimal, [to be defined....], full) just have a look at the busybox configuration system, it is IMHO the thing we need. Then, we should be able to add, (but that is probably harder work) 3) using the same dialog style script, select VM functionalities, with some Micro Edition special features. having 1 and 2 is just script work, (maybe a little bit harder for cross compilation) I would be glad to contribute on that. Alex, do not you think 1 and 2 should be great before creating a more lightweight Micro edition ? regards From james.hague@REDACTED Wed Jun 29 22:33:13 2005 From: james.hague@REDACTED (James Hague) Date: Wed, 29 Jun 2005 15:33:13 -0500 Subject: Erlang Micro Edition. In-Reply-To: <99d5966624241a2a42559190235ddfac@erlang-fr.org> References: <944da41d050629030019d5269d@mail.gmail.com> <99d5966624241a2a42559190235ddfac@erlang-fr.org> Message-ID: This is an interesting idea that comes up occasionally. Fundamentally, the issue is what is meant by "lightweight," and that probably depends on your definition of "embedded." If you're talking about a system that doesn't have the memory characteristics of a desktop system--one without any virtual memory--then the big issue is memory allocation and fragmentation. You can't just rely on allocating and freeing memory like crazy on something without virtual memory and fairly constrainted RAM size. If you're to the point where you need to trim the emulator executable way down, then Erlang may be the wrong tool for the job. That said, I'd love to see a trimmed down Erlang implementation, one that: 1. Is divorced from OTP. 2. Removes all of the cruft that's accumulated in the standard libraries. The most common use of ets, for example, is to implement hashed lookup. All of the match_spec stuff and from_dets/2 and foldl/3 and all that could be in a different module. See http://www.sics.se/~joe/calls_out.html for starters. 3. Is much easier to configure for embedded use. No setting up of applications and all that. Yuck. 4. (Possibly) uses sockets rather than Erlang-level distribution. From ok@REDACTED Thu Jun 30 00:04:00 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 30 Jun 2005 10:04:00 +1200 (NZST) Subject: Erlang Micro Edition. Message-ID: <200506292204.j5TM40UF009699@atlas.otago.ac.nz> From ok@REDACTED Thu Jun 30 00:09:08 2005 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 30 Jun 2005 10:09:08 +1200 (NZST) Subject: Erlang Micro Edition. Message-ID: <200506292209.j5TM98JJ516532@atlas.otago.ac.nz> Alex Arnon wrote: I would like to hear your opinions on the usefulness of creating a small-footprint Erlang VM. Compared with Java, Erlang *is* small-footprint. The smallest program I've ever managed to run with Sun's Java (on a Sun machine) was 32MB of virtual memory; Erlang is 7MB. Now that's with a whole lot of OTP stuff running (for example, there's space reserved for ets, although I have no ets tables in this test case). Presumably the best approach would be to start with Stand-Alone Erlang. From erik.reitsma@REDACTED Thu Jun 30 09:15:24 2005 From: erik.reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Thu, 30 Jun 2005 09:15:24 +0200 Subject: Erlang Micro Edition. Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB10C149F@esealmw107.eemea.ericsson.se> > Alex Arnon wrote: > I would like to hear your opinions on the usefulness of > creating a > small-footprint Erlang VM. > > Compared with Java, Erlang *is* small-footprint. > The smallest program I've ever managed to run with Sun's Java > (on a Sun machine) was 32MB of virtual memory; Erlang is 7MB. But a Java 2 Micro Edition requires a lot less memory (2MB or so), since it runs on mobile phones. So, even if Erlang is smaller that Java Standard Edition, it is no Micro Edition yet. I would love to be able to run Erlang on my Windows Mobile Edition phone (epecially with some GUI interface). *Erik. From erik.reitsma@REDACTED Thu Jun 30 09:24:09 2005 From: erik.reitsma@REDACTED (Erik Reitsma (RY/ETM)) Date: Thu, 30 Jun 2005 09:24:09 +0200 Subject: Stand-Alone Erlang (was RE: Erlang Micro Edition.) Message-ID: <110BA8ACEE682C479D0B008B6BE4AEB10C14A0@esealmw107.eemea.ericsson.se> > Presumably the best approach would be to start with > Stand-Alone Erlang. What is the status of Stand-Alone Erlang. especially for Windows? With erts-5.4.4 I was able to use the erl.exe and some other files, with a modified erl.ini and the ebin directories I needed, to get something that could be distributed in an installer for Windows. For some reason this no longer worked for erts-5.4.6. I would be very happy if I could simply create one or more files that I can give to people with clean Windows installations, so that they can run my Erlang software without a full installation of Erlang/OTP. And uninstalling the application should be simple too. Regards, *Erik. From alex.arnon@REDACTED Thu Jun 30 10:35:08 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Thu, 30 Jun 2005 11:35:08 +0300 Subject: Erlang Micro Edition. In-Reply-To: <110BA8ACEE682C479D0B008B6BE4AEB10C149F@esealmw107.eemea.ericsson.se> References: <110BA8ACEE682C479D0B008B6BE4AEB10C149F@esealmw107.eemea.ericsson.se> Message-ID: <944da41d050630013574bf6e15@mail.gmail.com> Thank you all very much for your answers. I see that every one of you sees it somewhat differently - this is very interesting, and more opinions would be most welcome :) Christophe, I was thinking more along the lines of trying to assess how large/heavy a ground-up rebuild of a VM that will be as simple as possible, with a minimum of BIFs and features. As Joe said, bignums will probably be out (though at least 32-bit integers must be supported), and as James suggested the library layout might be different. The thing is that it is difficult for me to assess the scope of such a project right now - I am not familiar with the operation of the VM, or even with the file format/bytecodes (though I have browsed a bit through docs and the code... does anyone have "proper", up-to-date documentation?). My gut feeling tells me that a ground-up rewrite is necessary: - Portability and embeddability. - As Christophe suggested, make support for low-level services (BIFs) a config-time selection. - Tighter control of operation. E.g. memory management strategy could be compile-time selectable. - A chance to find that minimal closure of functionality that a small embedded system would need. Cheers, Alex. From mickael.remond@REDACTED Thu Jun 30 12:13:28 2005 From: mickael.remond@REDACTED (Mickael Remond) Date: Thu, 30 Jun 2005 12:13:28 +0200 Subject: Stand-Alone Erlang (was RE: Erlang Micro Edition.) In-Reply-To: <110BA8ACEE682C479D0B008B6BE4AEB10C14A0@esealmw107.eemea.ericsson.se> References: <110BA8ACEE682C479D0B008B6BE4AEB10C14A0@esealmw107.eemea.ericsson.se> Message-ID: <42C3C5C8.6010503@erlang-fr.org> Erik Reitsma (RY/ETM) wrote: >>Presumably the best approach would be to start with >>Stand-Alone Erlang. > > What is the status of Stand-Alone Erlang. especially for Windows? With erts-5.4.4 I was able to use the erl.exe and some other files, with a modified erl.ini and the ebin directories I needed, to get something that could be distributed in an installer for Windows. For some reason this no longer worked for erts-5.4.6. > I would be very happy if I could simply create one or more files that I can give to people with clean Windows installations, so that they can run my Erlang software without a full installation of Erlang/OTP. And uninstalling the application should be simple too. I did not upgrade REPOS to the latest Erlang. Latest beta version use erts-5.4.4. I hope that there is a work around for this change as we wer using a modified erl.ini file to have relative path to be able to have an Erlang multi-platform on CDROM and freely installable on disk by a simple copy of the directory structure. Do you know Erik what has changed ? -- Micka?l R?mond From thomasl_erlang@REDACTED Thu Jun 30 13:49:30 2005 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 30 Jun 2005 04:49:30 -0700 (PDT) Subject: Erlang Micro Edition. In-Reply-To: <944da41d050630013574bf6e15@mail.gmail.com> Message-ID: <20050630114930.6373.qmail@web41904.mail.yahoo.com> --- Alex Arnon wrote: > Christophe, I was thinking more along the lines of > trying to assess > how large/heavy a ground-up rebuild of a VM that > will be as simple as > possible, with a minimum of BIFs and features. First of all, what's the point of an Erlang without BIFs and features? OK, I'm being a bit facetious, but there has to be a reason to choose Erlang too. Also, I would suspect that most developers want to add more nifty stuff for the next model, so things will likely creep back in. Restructuring the system to get rid of unused features may be a Good Thing even so. (By moving more features into Erlang, one can omit them more easily.) > My gut feeling tells me that a ground-up rewrite is > necessary: Uh-oh :-) First, let's see what can be done to the existing system. As a simple baseline, I stripped an R9C2 installation (x86, slackware): (I'm not sure how the executables are used, so I list them all) Before strip: 4282779 beam 4306296 beam.elib 4305231 beam.elib.shared 4281706 beam.shared After strip: 970192 beam 978544 beam.elib 985008 beam.elib.shared 976656 beam.shared So there are some easy gains to be made in storage space, at least. At startup, both the stripped and unstripped beam processes appear to occupy about ~4.2 MB of memory, of which ~1.4 MB is shared. Some flag tweaking may reduce that a bit further. The VM sees 2.8 MB of this: 0.6 MB is used by processes, and 2.2 MB shared (1.4 MB bytecode from 70 modules, the rest atoms, binaries, and ets). Of course, practical use will size up those areas. One real system, when idling after test, has a 7.4 MB VM, wherein 1.9 MB is used by processes, bytecode uses 4.0 MB (~250 loaded modules) and the rest is for ets, atoms and binaries. The entire (unstripped) process is 13 MB, which I'd say is fairly normal for a realistic Erlang node. Peak memory use may be much higher, of course. First, a database may increase the ets size quite a bit. Second, an active system will use more (transient) space for processes. Best, Thomas __________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html From luvishsatija@REDACTED Thu Jun 30 13:58:50 2005 From: luvishsatija@REDACTED (luvish satija) Date: Thu, 30 Jun 2005 12:58:50 +0100 (BST) Subject: strange behaviour with net_kernel:monitor_nodes Message-ID: <20050630115850.10399.qmail@web8508.mail.in.yahoo.com> Hello all, I am trying to make a simple network monitor. For that I ran a program consising of the following code (this is the concept which i'll be using in my monitor) -module(mon). -export([monitor/0,start/0]). start() -> net_kernel:connect_node(a@REDACTED), net_kernel:connect_node(b@REDACTED), spawn(mon,monitor,[]). monitor() -> case net_kernel:monitor_nodes(true) of ok -> receive {nodedown, Node}-> io:format("THE ~p NODE HAS BEEN DOWN and nodes is ~p.~n",[Node, nodes()]) end, monitor(); Other -> io:format("unable to start monitor") end. Firstly i started a@REDACTED, b@REDACTED and then i started my mon. To test, I first killed a@REDACTED and then b@REDACTED I got the following output: luvish $ erl -sname mon Erlang (BEAM) emulator version 5.1 [source] Eshell V5.1 (abort with ^G) (mon@REDACTED)1> mon:start(). <0.41.0> THE a@REDACTED NODE HAS BEEN DOWN and nodes is [b@REDACTED]. THE b@REDACTED NODE HAS BEEN DOWN and nodes is []. THE b@REDACTED NODE HAS BEEN DOWN and nodes is []. (mon@REDACTED)2> Now the problem is that I'm getting the nodedown message for b@REDACTED two times which is certainly not desirable. Becuse if some node gets down, then action should be taken only once. Note that second time, the value of nodes() is [], so logically, nobody is connected to mon@REDACTED now but still third line is printed. Am i missing something or more then one nodedown messages are sent (then a should also show the same behaviour)? Please help me to resolve this confusion. Thanks in advance, /luvish __________________________________________________________ How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com From eudesh@REDACTED Thu Jun 30 17:42:52 2005 From: eudesh@REDACTED (Eranga Udesh) Date: Thu, 30 Jun 2005 21:42:52 +0600 Subject: Distributed Erlang embeded startup problem Message-ID: Hi, I have created a target system. It's a distributed system, having 2 optional nodes, if one failes application failover to the other node. If the high priority node comes alive it takes over. Attached files are, sys.config - configuration file in one node. The other node's file just have the name of this node in "sync_nodes_optional" esme.system - Linux init file The init file is located at /etc/rc.d/init.d and in linked to /etc/rc.d/rc3.d/S91esme.system When I ran init files manually, the system starts well. When a node fails, it fall backs and everything works smoothly. But when I restart both systems, once they come up, I see both are running the same application. When I ran the nodes() in one node, I can see that it has connected to other node too. What puzzeling me is, why it runs correctly when I ran manually and why it doesn't in a system reboot. Please help. Thanks in advance, - Eranga -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: sys.config URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: esme.system URL: From samuel@REDACTED Thu Jun 30 18:20:33 2005 From: samuel@REDACTED (Samuel Rivas) Date: Thu, 30 Jun 2005 18:20:33 +0200 Subject: Undocumented socket options Message-ID: <20050630162033.GA15583@crusher.lfcia.pri> Hello, Digging in the source I've found several socket options that are missing in the documentation (e.g. multicast_ttl, multicast_if ...) Are they missing or unsupported? In other words, are they going to change/disappear in future releases? BTW, some time ago I had similar problems with the detection of the interfaces and their IP addresses http://www.erlang.org/ml-archive/erlang-questions/200401/msg00242.html Regards -- Samuel From alex.arnon@REDACTED Thu Jun 30 20:06:46 2005 From: alex.arnon@REDACTED (Alex Arnon) Date: Thu, 30 Jun 2005 21:06:46 +0300 Subject: Erlang Micro Edition. In-Reply-To: <20050630114930.6373.qmail@web41904.mail.yahoo.com> References: <944da41d050630013574bf6e15@mail.gmail.com> <20050630114930.6373.qmail@web41904.mail.yahoo.com> Message-ID: <944da41d050630110617a7d5c8@mail.gmail.com> On 6/30/05, Thomas Lindgren wrote: > > > --- Alex Arnon wrote: > > > Christophe, I was thinking more along the lines of > > trying to assess > > how large/heavy a ground-up rebuild of a VM that > > will be as simple as > > possible, with a minimum of BIFs and features. > > First of all, what's the point of an Erlang without > BIFs and features? > > OK, I'm being a bit facetious, but there has to be a > reason to choose Erlang too. Also, I would suspect > that most developers want to add more nifty stuff for > the next model, so things will likely creep back in. > > Restructuring the system to get rid of unused features > may be a Good Thing even so. (By moving more features > into Erlang, one can omit them more easily.) > > > My gut feeling tells me that a ground-up rewrite is > > necessary: > > Uh-oh :-) First, let's see what can be done to the > existing system. As a simple baseline, I stripped an > R9C2 installation (x86, slackware): > > (I'm not sure how the executables are used, so I list > them all) > > Before strip: > 4282779 beam > 4306296 beam.elib > 4305231 beam.elib.shared > 4281706 beam.shared > > After strip: > 970192 beam > 978544 beam.elib > 985008 beam.elib.shared > 976656 beam.shared > > So there are some easy gains to be made in storage > space, at least. > > At startup, both the stripped and unstripped beam > processes appear to occupy about ~4.2 MB of memory, of > which ~1.4 MB is shared. Some flag tweaking may reduce > that a bit further. > > The VM sees 2.8 MB of this: 0.6 MB is used by > processes, and 2.2 MB shared (1.4 MB bytecode from 70 > modules, the rest atoms, binaries, and ets). > > Of course, practical use will size up those areas. One > real system, when idling after test, has a 7.4 MB VM, > wherein 1.9 MB is used by processes, bytecode uses 4.0 > MB (~250 loaded modules) and the rest is for ets, > atoms and binaries. The entire (unstripped) process is > 13 MB, which I'd say is fairly normal for a realistic > Erlang node. > > Peak memory use may be much higher, of course. First, > a database may increase the ets size quite a bit. > Second, an active system will use more (transient) > space for processes. > > Best, > Thomas > > > > > __________________________________ > Yahoo! Mail > Stay connected, organized, and protected. Take the tour: > http://tour.mail.yahoo.com/mailtour.html > > Thomas, I'd like to give an example of what I would use a Micro-Edition for: Small device, e.g. home ADSL router. This machine would have a small Linux or NetBSD kernel running, possibly an SSH daemon and a few other processes. Memory budget = ~8MB. Maybe 12 or 16. I'd like to envision an Erlang VM which would perform all (or most) high-level services: - It would have access to sockets (including RAW ones) and pipes. - It would be able to open files and read/write. binary<=>eterm would be useful in any case. - I would like to be able to easily build and link in port drivers for controlling special devices. - I would like to be able to constrain resource usage per application, e.g.: - Process priorities. - Memory usage constraints (per-process or process group). Now, how cut-down would the functionality of such a VM and standard library be? Would a statically-linked one take less than a MB? More? About 500KB, maybe? How about the runtime usage? Could we write a DHCP server that would need only 30KB of heap space? A web management interface - 200K? From klacke@REDACTED Thu Jun 30 22:26:39 2005 From: klacke@REDACTED (Claes Wikstom) Date: Thu, 30 Jun 2005 22:26:39 +0200 Subject: YAWS Website Down? In-Reply-To: <20050630080509.A2C9E469DB@bang.trapexit.org> References: <20050630080509.A2C9E469DB@bang.trapexit.org> Message-ID: <42C4557F.5060004@hyber.org> tobbe wrote: > Yes, it seem to be down. > I've sent klacke an SMS about it. Thanks, so goddamn typical that think fuckup just the week you go on vacation. It's up now, system was in really bad shape. Erlang had apparently crashed and the 'heart' process which was ment to restart the crashed emulator was in state Not good :-( /klacke From matthias@REDACTED Thu Jun 30 23:27:30 2005 From: matthias@REDACTED (Matthias Lang) Date: Thu, 30 Jun 2005 23:27:30 +0200 Subject: Erlang Micro Edition. In-Reply-To: <944da41d050630110617a7d5c8@mail.gmail.com> References: <944da41d050630013574bf6e15@mail.gmail.com> <20050630114930.6373.qmail@web41904.mail.yahoo.com> <944da41d050630110617a7d5c8@mail.gmail.com> Message-ID: <17092.25538.528942.681751@antilipe.corelatus.se> Alex Arnon writes: > I'd like to give an example of what I would use a Micro-Edition for: > Small device, e.g. home ADSL router. This machine would have a small > Linux or NetBSD kernel running, possibly an SSH daemon and a few other > processes. Memory budget = ~8MB. Maybe 12 or 16. I have a device at home which you could call an "ADSL router". It sits between my ADSL modem and my PC. It has two ethernet ports, a 50MHz PPC CPU and 32MByte of DRAM. It runs Erlang R9C to do some port forwarding, act as an HTTP proxy, an FTP proxy, a dynamic DNS client and to re-login to ADSL whenever my ISP kicks me out. Right now, the Erlang VM has RSS = 4556kByte. Matthias