From peter@REDACTED Thu Aug 2 18:48:02 2001 From: peter@REDACTED (Peter H|gfeldt) Date: Thu, 2 Aug 2001 18:48:02 +0200 (MET DST) Subject: SSL application and OpenSSL Message-ID: Has anyone tried to use OpenSSL instead of SSLeay for the Erlang/OTP SSL application? Unix or Win32? I am asking because I'm considering moving to OpenSSL, which is the right thing to do, since SSLeay is the base for OpenSSL. However, the support for Win32 in OpenSSL does not seem to be whole-hearted, and is based on the now obsolete WinSock 1.1 implementation (containing atrocities such as `WSACancelBlockingCall'). /Peter Peter H?gfeldt e-mail : peter@REDACTED Open Telecom Platform From vances@REDACTED Thu Aug 2 19:45:12 2001 From: vances@REDACTED (Vance Shipley) Date: Thu, 2 Aug 2001 13:45:12 -0400 Subject: SSL application and OpenSSL In-Reply-To: Message-ID: > Has anyone tried to use OpenSSL instead of SSLeay for the Erlang/OTP SSL > application? Unix or Win32? I build with openssl-0.9.6 on RedHat linux and it just works, no special configuration. I don't actually use SSL but I know that crypt works. -Vance Motivity Telecom Inc. From matthias@REDACTED Thu Aug 2 21:23:58 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Thu, 2 Aug 2001 21:23:58 +0200 Subject: EPL question Message-ID: <15209.43214.373212.866773@antilipe.corelatus.se> Hi, I haven't detected any great interest in the licence before, but I'll post my late-night wonderings anyway. The GPL explicitly says that I can make distribute programs I compile using a GNU compiler without the result falling under the GPL gpl> the output from the Program is covered only if its contents gpl> constitute a work based on the Program (independent of gpl> having been made by running the Program). The EPL has no such statement. As far as I can tell, and I am neither a lawyer, nor do I play one on TV, the EPL handles this by distinguishing between a "Larger Work" and a "Modification". My own programs don't seem to fall under the definition of "Modification", so they don't have to be distributed under the EPL conditions. Even linking with erl_interface seems to be borderline OK since I'm not changing any of the original files. Matthias From matthias@REDACTED Thu Aug 2 22:40:52 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Thu, 2 Aug 2001 22:40:52 +0200 Subject: Three IO library related problems Message-ID: <15209.47828.851685.843103@antilipe.corelatus.se> #1 In R7B-3: 18> io_lib:fread("~d.~d", "22"). =ERROR REPORT==== 2-Aug-2001::21:37:53 === ERROR: "Error in process <0.54.0> with exit value: {function_clause,[{io_lib_fread,fread,[\".~d\",[],2,[22]]}, {erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]}\n" ** exited: {function_clause,[{io_lib_fread,fread,[".~d",[],2,[22]]}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]} ** I think it should return {more, ....}. The thought of patching io_lib_fread.erl without a test suite makes me feel weak. 'catch' is a halfway useful workaround. ---- #2 On a related note, it'd be nice if the man page/web page for io_lib said that the {more, ....} tuple returned from fread/2 can be used as a continuation for fread/3. -------------------- #3 Back in November there was a discussion about operations with binaries and io sometimes guzzling memory. Just writing 3> {bla, Bin}. on the shell prompt for a modest-sized binary would consume huge amounts of RAM. This was traced to a bug in io_lib_pretty and Robert Virding posted a fix to the mailing list. The fix isn't in R7B-3. Has this slipped between the cracks, or is it waiting for a volunteer to submit a proper diff? Robert's post: http://www.erlang.org/ml-archive/erlang-questions/200011/msg00112.html Matthias From hal@REDACTED Thu Aug 2 23:00:07 2001 From: hal@REDACTED (Hal Snyder) Date: 02 Aug 2001 16:00:07 -0500 Subject: SSL application and OpenSSL In-Reply-To: References: Message-ID: <87d76ech48.fsf@ghidra.vail> Peter H|gfeldt writes: > Has anyone tried to use OpenSSL instead of SSLeay for the Erlang/OTP > SSL application? Unix or Win32? We have been linking erlang with OpenBSD's integrated OpenSSL support. Have only poked around with a couple test programs, but it seems to work. From gupta@REDACTED Thu Aug 2 21:10:04 2001 From: gupta@REDACTED (Gopal Gupta) Date: Thu, 2 Aug 2001 14:10:04 -0500 Subject: PADL'01 Final Call for Papers Message-ID: <200108021910.f72JA4Y26897@herbrand.utdallas.edu> [- Apologies for multiple messages; - Paper submission deadline is August 10th. - PADL'02 proceedings will be published as Springer Verlag LNCS, past proceedings can be found in LNCS 1551, 1753 and 1990. ] FINAL CALL FOR PAPERS!!! FINAL CALL FOR PAPERS!!! Fourth International Symposium on Practical Aspects of Declarative Languages http://www.cs.sunysb.edu/~padl2002 (PADL '02) Portland, Oregon, USA Jan 19-20, 2002 Co-located with POPL 2002 Declarative languages build on sound theoretical bases to provide attractive frameworks for application development. These languages have been successfully applied to vastly different real-world situations, ranging from data base management to active networks to software engineering to decision support systems. New developments in theory and implementation have opened up new application areas. At the same time, applications of declarative languages to novel problems raises numerous interesting research issues. Well-known questions include designing for scalability, language extensions for application deployment, and programming environments. Thus, applications drive the progress in the theory and implementation of declarative systems, and benefit from this progress as well. PADL provides a forum for researchers, practitioners, and implementors of declarative languages to exchange ideas on current and novel application areas and on the requirements for effective deployment of declarative systems. We invite papers dealing with practical applications of newly discovered results and techniques in logic, constraint, and functional programming. Papers dealing with practical applications of theoretical results, new techniques of implementation with considerable impact on an application, or innovative applications are particularly welcome. Position papers as well as papers that present works in progress are also welcome. The scope of PADL includes, but is not limited to: o Innovative applications of declarative languages o Declarative domain-specific languages and applications o New developments in declarative languages and their impact on applications o Practical experiences o Evaluation of implementation techniques on practical applications o Novel uses of declarative languages in the classroom The papers should highlight the practical contribution of the work and the relevance of declarative languages to achieve that end. PADL 2002 will co-locate with ACM POPL 2002, in Portland, Oregon. Previous PADLs were held in San Antonio (1999), Boston (2000), and Las Vegas (2001). Important Dates: o Paper Submission: Aug. 10, 2001 o Notification: Oct. 8, 2001 o Camera Ready: Nov. 5, 2001 o Symposium: Jan. 19-20, 2002 Paper Submission: Authors should submit an electronic copy of the full paper (written in English) in Postscript (Level 2) or PDF. Papers must be no longer than 15 pages, written in 11-point font and with single spacing. Since the final proceedings will be published as Lecture Notes in Computer Science by Springer Verlag, authors are strongly encouraged to use the LNCS paper formatting guidelines for their submission. Each submission must include, on its 1st page, the paper title; authors and their affiliations; contact author's email and postal addresses, telephone and fax numbers, abstract, and three to four keywords. The keywords will be used to assist us in selecting appropriate reviewers for the paper. If electronic submission is impossible, please contact the program co-chairs for information on how to submit hard copies. Program Committee: o Sergio Antoy, Portland State University, USA o Gopal Gupta, UT Dallas (Organizer) o Joxan Jaffar, National University of Singapore o Fergus Henderson, University of Melbourne, Australia o Shriram Krishnamurthi, Brown University, USA (Program Co-chair) o Andrew Kennedy, Microsoft Research, UK o Michael Leuschel, University of Southampton, UK o Kim Marriott, Monash University, Australia o John Peterson, Yale University, USA o Andreas Podelski, MPI, Germany o Enrico Pontelli, New Mexico State University, USA o C.R. Ramakrishnan, SUNY, Stony Brook, USA (Program Co-chair) o John Reppy, Bell Labs Lucent Technologies o Manuel Serrano, Universit'e de Nice, France o Olin Shivers, Georgia Tech, USA o Paul Tarau, University of North Texas, USA For more Information, please contact C.R. Ramakrishnan Computer Science Department SUNY at Stony Brook Stony Brook, NY 11794-4400 USA email: cram@REDACTED From raimo@REDACTED Fri Aug 3 10:05:29 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Fri, 03 Aug 2001 10:05:29 +0200 Subject: Multithreaded Drivers References: <402DD461F109D411977E0008C791C312039F61A5@imp02mbx.one2one.co.uk> Message-ID: <3B6A5B49.B344CE09@erix.ericsson.se> I managed to send this message to Sean only, missed the list, and finally now fixes that mistake... / Raimo Niskanen, Erlang/OTP, Ericsson UAB. ------------------------------------------------------------------------------------------ Sorry for the delay, Sean, I just came back from my vacation. Answers inserted below... Sean Hinde wrote: > > All, > > I'm digging through the existing drivers trying to figure out how they > work.. Particularly with regard to multithreaded drivers. > > So far I have figured out from studying efile_drv that: > > The start function should return a pointer to the struct which holds all the > state for the thread. This is so that each call to open_port will generate > it's own state which is passed to whichever thread happens to be used to > process the call. This pointer is cast to a long to keep the type system > happy :) > The start function and all driver callback functions are called in the same thread context, i.e the emulator main thread. The emulator is using only one thread, the main thread, and emulates all erlang processes in that thread. This is to avoid platform dependant and time consuming thread locking between erlang processes. The multithread interface that efile_drv uses is the only way to execute in other threads from within the emulator (expect for some obscure support threads), and the only code that executes in other threads are the callback (worker) functions given to driver_async(). Therefore all thread specific data must be accessible through the data pointer also given to driver_async(). > Q. Can I use the new erl_driver.h functions with multithreaded drivers (I > notice that not all the functions in driver.h are included in the new one, > particularly driver_async)? > We have tried for a while to get rid of driver.h, and for R8 it finally seems to happen; erl_driver.h will then (probably) contain all functions from driver.h. > Q. I presume if so I can just cast the pointer to my state into a > ErlDrvData? > Yes. > The start function in efile_drv uses the function sys_alloc_from(200, > sizeof(file_descriptor_state_struct)). I can't figure out the point of the > 200, or how to decide what it should be in my case. As far as I can make out > it only has an effect in an instrumented system (from looking at the def in > sys.h). > Correct, it is used for an instrumented system. You can look in the source code for instrument.erl in application 'tools' to see the values that are defined today. > Q. What is the approved way to assign and clear memory in this case and in > drivers in general? > To allocate and free memory please use driver_alloc(), driver_realloc() and driver_free() in erl_driver.h. Also, driver_alloc_binary(), driver_realloc_binary() and driver_free_binary() may be useful. > Q. Under what circumstances is the free function passed to driver_async > called (I couldn't find any from a quick look)? > When an async request is cancelled with driver_async_cancel(), and the request has not started to run yet. Either the free function or the driver callback async_ready is called. When a port is closing while having unfinished async requests. The driver callbacks cannot be called since the port is regarded as closed. > Q. What is the key parameter intended for and do I ever need to worry about > it? > The key parameter is used to select thread. If it is NULL, as for efile_drv, the requests are round robin scheduled on the threads in the async thread pool. Otherwise it must be a pointer to an integer that is used to select thread through a simple hash function (modulo number of threads). E.g efile_drv may have to worry about this when (if) it becomes possible to access a file from different erlang processes. Requests to one specific file must then be handled by the same thread, or else a read from one erlang process could run ahead of a write from another erlang process by using a different thread. Therefore efile_drv must use maybe the file descriptor or perhaps the port number as key, it must be an integer unique for the file. > I've got the hang of the idea that the main function driven by > port_command/2 should just schedule the work to be done in a thread sometime > later with the driver_async function, and that when the thread has done it's > work for this time it puts itself into the queue to call the async_ready > callback which sends the result back to erlang. This looks fine.. > > Q. What happens if I send another port_command/2 to the port before the > result of the possibly time consuming last operation has returned? > This is entirely up to your interface between the erlang process and the driver. You decide if the erlang process should wait for a message from the port after each port_command/2 or not. Messages are sent asynchronously from the erlang process to the port with port_command/2, and the other way (also asynchronously) with driver_output*(). Note that set_busy_port() can be used to suspend future port_command/2. Synchronous calls from erlang processes to the port are made with port_control/3. > Q. I wonder if I can use this to call the driver_cancel function sometime > later to abort the operation? > Yes you can, until the request has started to run on a thread in the thread pool. The function driver_async_cancel() returns 1 if the request was cancelled, and 0 if the request could not be found in the queues (might be running, or has alread run, or invalid async_id). > Q. What is the best way to timeout the operation which is being carried out > in a thread so I can return the resource to useful state (in case it is in > an endless loop, or the far end of some link has died leaving the thread > waiting forever..)? > While the thread is running it cannot be cancelled. This also blocks all async requests that may be scheduled on the same thread later. All async requests must be reasonably short, or else they will slow down e.g efile_drv. It is best if the worker function itself can limit its execution time. It might be possible to use the erts_mutex*() and erst_cond*() functions in some way, but the water is getting deep here... > > > Hope this helps you forward. / Raimo Niskanen, Erlang/OTP, Ericsson UAB. From raimo@REDACTED Fri Aug 3 10:11:08 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Fri, 03 Aug 2001 10:11:08 +0200 Subject: Multithreaded Drivers References: <402DD461F109D411977E0008C791C312039F61A5@imp02mbx.one2one.co.uk>, <3B6A5B49.B344CE09@erix.ericsson.se> Message-ID: <3B6A5C9C.D28E87CE@erix.ericsson.se> And here is some more info on the same subject that I think is of public interest... / Raimo Niskanen, Erlang/OTP, Ericsson UAB. ------------------------------------------------------------------------------------------ Sean Hinde wrote: > > Raimo, > > Another question.. Has anyone ever experimented with avoiding the copying of > data between the erlang thread and the worker thread? Perhaps by using a > mutex type arrangement, or even by simply ensuring that the erlang side > doesn't send any more data to overwrite the buffer until it is given > permission to do so. > Yes, I have. I am rewriting efile_drv to store file data in the port queue. Then data is accessed both from the main thread and from the worker threads. Access is protected by a mutex in the port data structure. So far it seems to work fine. Beware of the danger the port being closed at any time, meaning that the port data structure and hence the mutex can be freed and perhaps overwritten at any time, so a worker thread might get the mutex corrupted at any time. I happen to avoid this since the port will not be closed while there is data in the port queue. A workaround for other cases might be to store a byte in the port queue while there are unfinished async requests. / Raimo From snickl@REDACTED Fri Aug 3 11:10:04 2001 From: snickl@REDACTED (snickl@REDACTED) Date: Fri, 3 Aug 2001 11:10:04 +0200 (CEST) Subject: restore function Message-ID: Hi, can anyone show/point me to some examples on how to use the restore function when implementing c_server callbacks from IC? The archive contains an entry http://www.erlang.org/ml-archive/erlang-questions/200005/msg00004.html It was solved, but this was quite a special case (global variable). Well, I feel this matter is a bit short in docs/examples, and I really can't make sense of that abstract paragraph nr. 2 in the docs, sorry. But I think what it boils down to is the (simple) question: Do I really have to free _every_complex_thing_, in or out, allocated by myself or by the stubs in the restore function? CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From nico.weling@REDACTED Fri Aug 3 11:24:31 2001 From: nico.weling@REDACTED (Nico Weling) Date: Fri, 03 Aug 2001 11:24:31 +0200 Subject: GIF in button? Message-ID: <3B6A6DCF.4EEBFBB@eed.ericsson.se> Hi, is it possible to insert an image (or canvas object) into an button with Erlang-GS. For example a play-button with a triangle inside. Thanks, Nico. From nico.weling@REDACTED Fri Aug 3 14:31:31 2001 From: nico.weling@REDACTED (Nico Weling) Date: Fri, 03 Aug 2001 14:31:31 +0200 Subject: GIF in button? References: Message-ID: <3B6A99A3.2F2D71@eed.ericsson.se> Hi, I've tried out this example and I've created the image stopsign as bmp, gif and xpm but the button does not appear. -rw-r--r-- 1 eedniwe 578 Aug 3 14:30 stopsign.bmp WHY??? -module(ex11). -copyright('Copyright (c) 1991-97 Ericsson Telecom AB'). -vsn('$Revision: /main/release/3 $ '). -export([start/0,init/0]). start() -> spawn(ex11,init,[]). init() -> I= gs:start(), W= gs:window(I,[{title,"Color Demo"}, {width,300},{height,195}]), B=gs:button(W,[{label,{image,"stopsign.bmp"}},{x,271},{y,166}, {width,30}]), gs:config(B,[{bg,yellow},{fg,hotpink1},{data,quit}]), gs:scale(W,[{text,"Red"},{y,0},{range,{0,255}}, {orient,horizontal}, {height,65},{data,red},{pos,42}]), gs:scale(W,[{text,"Blue"},{y,65},{range,{0,255}}, {orient,horizontal}, {height,65},{data,blue},{pos,42}]), gs:scale(W,[{text,"Green"},{y,130},{range,{0,255}}, {orient,horizontal}, {height,65},{data,green},{pos,42}]), gs:config(W,{map,true}), loop(W,0,0,0). loop(W,R,G,B) -> gs:config(W,{bg,{R,G,B}}), receive {gs,_,click,red,[New_R|_]} -> loop(W,New_R,G,B); {gs,_,click,green,[New_G|_]} -> loop(W,R,New_G,B); {gs,_,click,blue,[New_B|_]} -> loop(W,R,G,New_B); {gs,_,click,quit,_} -> true; {gs,W,destroy,_,_} -> true end. Best regards, Nico. From etxhste@REDACTED Fri Aug 3 14:41:16 2001 From: etxhste@REDACTED (Hakan Stenholm) Date: Fri, 3 Aug 2001 14:41:16 +0200 (MET DST) Subject: GIF in button ? Message-ID: <200108031241.OAA16683@avc240.etxb.ericsson.se> Looking at the documentation I would say NO: * the only legal parents of a canvas is a window or frame i.e. a canvas can't be inserted into a button * the button has no gif option and neither is there such and option in the list of generic options that any widget can use. Your best choice is to either use ascii chars "<" and ">" as arrows or use something else than gs, for example etk, java or some other graphics library. H?kan Stenholm From snickl@REDACTED Fri Aug 3 14:45:28 2001 From: snickl@REDACTED (snickl@REDACTED) Date: Fri, 3 Aug 2001 14:45:28 +0200 (CEST) Subject: GIF in button? In-Reply-To: <3B6A99A3.2F2D71@eed.ericsson.se> Message-ID: it works with otp_src_R7B-3/lib/gs/c_src/lib/tk4.2/library/updir.xbm renamed to "die_icon" (no extension) on linux. CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From Eworldlife@REDACTED Fri Aug 3 16:11:25 2001 From: Eworldlife@REDACTED (Eworldlife@REDACTED) Date: Fri, 3 Aug 2001 16:11:25 Subject: Visit E-bay Message-ID: <54.669015.834833@excite.com> An HTML attachment was scrubbed... URL: From luke@REDACTED Mon Aug 6 09:26:34 2001 From: luke@REDACTED (Luke Gorrie) Date: 06 Aug 2001 09:26:34 +0200 Subject: export_to (Was: Re: the OO metaphor) In-Reply-To: References: Message-ID: Ulf Wiger writes: > >Maybe if you use module_info/0 for looking up functions you can get > >in trouble, but I guess most people only do that for throw-away use > >in the shell if at all. > > Hehe, I'd like to see some code that actually does something useful by > calling module info, and then simply going through the list of > exported functions and calling them, just to see what would happen. Pardon the late (8 months) reply, but I just found a use for calling module_info in a program :-) I have a module that exports a bunch of functions which are the BIFs of a small embedded language. It also exports another few "meta" functions which aren't supposed to be callable as BIFs. So I make a "non_bif_exports()" function containing a [{Name, Arity}] list of the exported functions that aren't BIFs, then have bifs() -> ?MODULE:module_info(exports) -- non_bif_exports(). Which I claim is at least a defensible use of module_info in a real program :-) Cheers, Luke From martin.nilsson@REDACTED Tue Aug 7 10:42:24 2001 From: martin.nilsson@REDACTED (Martin Nilsson) Date: Tue, 7 Aug 2001 10:42:24 +0200 Subject: Connection attempt from disallowed node Message-ID: Hello I'm trying to do a simple chat application with a server and a chat client. The server and client are run on separate nodes and, preferrably, on different hosts. The client can connect to the server if it is run on the same host (but different node) as the server but if I try to connect the client from a different host I get the following error message: =ERROR REPORT==== 7-Aug-2001::10:29:39 === ** Connection attempt from disallowed node 'apa@REDACTED' Is there some way to make the node "allowed"? TIA /Martin Nilsson __________________________________________________________ Martin Nilsson Software designer________________________________________ Ericsson Compitex AB Tel: +46 (0)31 709 67 20 Wallinsgatan 6 Fax: +46 (0)31 709 92 01 43141 M?lndal Mobile: +46 (0)730 49 76 58 Sweden e-mail: martin.nilsson@REDACTED From Chandrashekhar.Mullaparthi@REDACTED Tue Aug 7 11:00:13 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 7 Aug 2001 10:00:13 +0100 Subject: Connection attempt from disallowed node Message-ID: <402DD461F109D411977E0008C791C31205E06041@imp02mbx.one2one.co.uk> Start both nodes with the same cookie. You can set the cookie explicitly as erl -sname server -setcookie chat_cookie erl -sname client -setcookie chat_cookie If not explicitly set, the shell searches for a cookie file .erlang.cookie in the current directory and then your home directory. If none is specified/exists it creates a file .erlang.cookie with some value in it. hth Chandru > -----Original Message----- > From: Martin Nilsson [mailto:martin.nilsson@REDACTED] > Sent: 7 August 2001 09:42 > To: erlang-questions@REDACTED > Subject: Connection attempt from disallowed node > > > Hello > > I'm trying to do a simple chat application with a server and a chat > client. The server and client are run on separate nodes and, > preferrably, on different hosts. The client can connect to > the server if > it is run on the same host (but different node) as the server but if I > try to connect the client from a different host I get the following > error message: > > =ERROR REPORT==== 7-Aug-2001::10:29:39 === > ** Connection attempt from disallowed node 'apa@REDACTED' > > Is there some way to make the node "allowed"? > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From kristoffer.andersson@REDACTED Tue Aug 7 14:35:23 2001 From: kristoffer.andersson@REDACTED (Kristoffer Andersson) Date: Tue, 07 Aug 2001 11:35:23 -0100 Subject: Erlang and Solaris 8 Message-ID: <3B6FE08B.6020205@mobilearts.se> Hi all! Is Erlang/OTP available for the Solaris 8 (Sparc, 64 bit) platform?? On www.erlang.se it says that it is available for Solaris (Sparc) in general. Does anyone know? Thanks! Regards... /Toffe -- Kristoffer Andersson Mobilearts mail: kristoffer.andersson@REDACTED mobile: +46733358404 From jabba@REDACTED Tue Aug 7 12:08:25 2001 From: jabba@REDACTED (Jani Launonen) Date: Tue, 7 Aug 2001 13:08:25 +0300 (EEST) Subject: Erlang and Solaris 8 In-Reply-To: <3B6FE08B.6020205@mobilearts.se> Message-ID: >Hi all! > >Is Erlang/OTP available for the Solaris 8 (Sparc, 64 bit) platform?? >On www.erlang.se it says that it is available for Solaris (Sparc) in >general. > >Does anyone know? tk11(pts/8) /home/jabba> isainfo -v 64-bit sparcv9 applications 32-bit sparc applications tk11(pts/8) /home/jabba> uname -a SunOS tk11 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-5_10 tk11(pts/8) /home/jabba> erl -version Erlang (THREADS) (BEAM) emulator version 5.0.2.4 tk11(pts/8) /home/jabba> Works for me. It's the R7B3 compiled from sources. >Thanks! You're welcome. >Regards... >/Toffe > >-- >Kristoffer Andersson >Mobilearts >mail: >kristoffer.andersson@REDACTED >mobile: >+46733358404 > > -+-+-+- Jani Launonen Student. . . . . . . . . .University of Oulu, Dept. of EE Assistant Researcher . . .Genie of the Net Project From bjarne@REDACTED Tue Aug 7 17:21:10 2001 From: bjarne@REDACTED (Bjarne =?iso-8859-1?Q?D=E4cker?=) Date: Tue, 07 Aug 2001 17:21:10 +0200 Subject: Erlang User Conference 2001 Message-ID: <3B700766.141E618D@erix.ericsson.se> Erlang users and developers world-wide are welcome to this year's Erlang/OTP user conference, EUC'2001, which takes place in Stockholm on September 27. Please see http://www.erlang.se/euc/01/ which contains conference programme and other information. Last year's conference was over-subscribed so, please, do not wait too long to register ! Welcome Bjarne D?cker, programme chairman From stephen_purcell@REDACTED Wed Aug 8 10:53:50 2001 From: stephen_purcell@REDACTED (Steve Purcell) Date: Wed, 8 Aug 2001 10:53:50 +0200 Subject: Problems with sample httpd setup Message-ID: <20010808105350.A19396@freedom.puma-ag.com> O Wise Ones, I'm running the Open Source Erlang packaged with Debian Linux; version 7.3, containing erts version 5.0.2.4 and inets version 2.5.6. Having copied the sample server_root to '/var/tmp' and set the ServerName, I can then start httpd successfully using the method prescribed in the docs:- Erlang (BEAM) emulator version 5.0.2.4 [source] Eshell V5.0.2.4 (abort with ^G) 1> httpd:start(). {ok,<0.31.0>} However, when I then make a request (from a variety of standard browsers) to the server (via http://localhost:8888/), the server disconnects and the error log shows up the following mis-formatted message which I partially decoded as 'Error reading request': [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1, reason: [69, 114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114, 101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100, 101, 114, 32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256", 32, 43, 32, "223"]] Is this a known problem? Any help would be appreciated. (I would prefer to get a working example configuration for my installed erlang components than to upgrade those components.) Thanks in advance, -Steve From Erik.Reitsma@REDACTED Wed Aug 8 11:09:20 2001 From: Erik.Reitsma@REDACTED (Erik Reitsma (ELN)) Date: Wed, 8 Aug 2001 11:09:20 +0200 Subject: Problems with sample httpd setup Message-ID: If you flatten the error list (e.g. lists:flatten(...)), you will find that the error is: "Error reading request: header too long: 256 + 223" May somebody wiser find what this means for you. > I'm running the Open Source Erlang packaged with Debian > Linux; version 7.3, > containing erts version 5.0.2.4 and inets version 2.5.6. > > Having copied the sample server_root to '/var/tmp' and set > the ServerName, > I can then start httpd successfully using the method prescribed in > the docs:- > > Erlang (BEAM) emulator version 5.0.2.4 [source] > > Eshell V5.0.2.4 (abort with ^G) > 1> httpd:start(). > {ok,<0.31.0>} > > However, when I then make a request (from a variety of > standard browsers) to > the server (via http://localhost:8888/), the server > disconnects and the error > log shows up the following mis-formatted message which I partially > decoded as 'Error reading request': > > [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1, > reason: [69, > 114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114, > 101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100, > 101, 114, > 32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256", > 32, 43, 32, > "223"]] > > Is this a known problem? Any help would be appreciated. (I > would prefer to > get a working example configuration for my installed erlang > components than > to upgrade those components.) > > Thanks in advance, > > -Steve > From Chandrashekhar.Mullaparthi@REDACTED Wed Aug 8 11:20:16 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 8 Aug 2001 10:20:16 +0100 Subject: Problems with sample httpd setup Message-ID: <402DD461F109D411977E0008C791C31205E06057@imp02mbx.one2one.co.uk> Steve, Looks like this is caused because the default setting for MaxHeaderSize(256) is too less for most browsers. Increase the values for this and you should be ok. Chandru > -----Original Message----- > From: Steve Purcell [mailto:stephen_purcell@REDACTED] > Sent: 8 August 2001 09:54 > To: erlang-questions@REDACTED > Subject: Problems with sample httpd setup > > > O Wise Ones, > > I'm running the Open Source Erlang packaged with Debian > Linux; version 7.3, > containing erts version 5.0.2.4 and inets version 2.5.6. > > Having copied the sample server_root to '/var/tmp' and set > the ServerName, > I can then start httpd successfully using the method prescribed in > the docs:- > > Erlang (BEAM) emulator version 5.0.2.4 [source] > > Eshell V5.0.2.4 (abort with ^G) > 1> httpd:start(). > {ok,<0.31.0>} > > However, when I then make a request (from a variety of > standard browsers) to > the server (via http://localhost:8888/), the server > disconnects and the error > log shows up the following mis-formatted message which I partially > decoded as 'Error reading request': > > [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1, > reason: [69, > 114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114, > 101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100, > 101, 114, > 32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256", > 32, 43, 32, > "223"]] > > Is this a known problem? Any help would be appreciated. (I > would prefer to > get a working example configuration for my installed erlang > components than > to upgrade those components.) > > Thanks in advance, > > -Steve > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From stephen_purcell@REDACTED Wed Aug 8 11:24:24 2001 From: stephen_purcell@REDACTED (Steve Purcell) Date: Wed, 8 Aug 2001 11:24:24 +0200 Subject: Problems with sample httpd setup In-Reply-To: References: Message-ID: <20010808112424.A19509@freedom.puma-ag.com> Erik Reitsma (ELN) wrote: > If you flatten the error list (e.g. lists:flatten(...)), you will find > that the error is: > > "Error reading request: header too long: 256 + 223" Aha! Thanks. > May somebody wiser find what this means for you. I got lucky and figured it out myself by following the error message back to its source in the code; I needed to add the following to the httpd conf file: MaxHeaderSize 800 Then, everything appears to work okay. The default is 256, which would seem to be inadequate. (I'm still not sure *which* header was too long.) Thanks again, -Steve From Bruce@REDACTED Wed Aug 8 11:39:40 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Wed, 8 Aug 2001 21:39:40 +1200 Subject: Problems with sample httpd setup References: <20010808105350.A19396@freedom.puma-ag.com> Message-ID: <059701c11fee$0bf222a0$0221970a@neolineas.com> Hi Steve, > Is this a known problem? Any help would be appreciated. (I would prefer to > get a working example configuration for my installed erlang components than > to upgrade those components.) Try putting MaxHeaderSize 1024 MaxBodySize 20000 into your .conf file (the values shown are what I use...YMMV). These options are undocumented as far as I could see - I spelunked the code. I think the problem has been mentioned before on this list though. The max header size defaults to 256. Cheers, Bruce From micael.karlberg@REDACTED Wed Aug 8 11:43:03 2001 From: micael.karlberg@REDACTED (Micael Karlberg) Date: Wed, 08 Aug 2001 11:43:03 +0200 Subject: Problems with sample httpd setup References: Message-ID: <3B7109A7.4856CA94@ericsson.com> Erik Reitsma ELN wrote: > > If you flatten the error list (e.g. lists:flatten(...)), > you will find that the error is: > > "Error reading request: header too long: 256 + 223" > > May somebody wiser find what this means for you. This is actually the result of a bad default value. From the notes file of release 2.6.0 (not yet released): Bad choice of default values for MaxHeaderSize (256) and MaxBodySize (1024). This in combination with a badly formatted error message makes the resulting behaviour hard to diagnose. Set these directives in the config file to something appropriate (higher). /BMK > > > I'm running the Open Source Erlang packaged with Debian > > Linux; version 7.3, > > containing erts version 5.0.2.4 and inets version 2.5.6. > > > > Having copied the sample server_root to '/var/tmp' and set > > the ServerName, > > I can then start httpd successfully using the method prescribed in > > the docs:- > > > > Erlang (BEAM) emulator version 5.0.2.4 [source] > > > > Eshell V5.0.2.4 (abort with ^G) > > 1> httpd:start(). > > {ok,<0.31.0>} > > > > However, when I then make a request (from a variety of > > standard browsers) to > > the server (via http://localhost:8888/), the server > > disconnects and the error > > log shows up the following mis-formatted message which I partially > > decoded as 'Error reading request': > > > > [08/Aug/2001:10:48:20 +0200] server crash for 127.0.0.1, > > reason: [69, > > 114, 114, 111, 114, 32, 114, 101, 97, 100, 105, 110, 103, 32, 114, > > 101, 113, 117, 101, 115, 116, 58, 32, [104, 101, 97, 100, > > 101, 114, > > 32, 116, 111, 111, 32, 108, 111, 110, 103, 58, 32, "256", > > 32, 43, 32, > > "223"]] > > > > Is this a known problem? Any help would be appreciated. (I > > would prefer to > > get a working example configuration for my installed erlang > > components than > > to upgrade those components.) > > > > Thanks in advance, > > > > -Steve > > From Chandrashekhar.Mullaparthi@REDACTED Wed Aug 8 11:55:30 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Wed, 8 Aug 2001 10:55:30 +0100 Subject: Problems with sample httpd setup Message-ID: <402DD461F109D411977E0008C791C31205E06058@imp02mbx.one2one.co.uk> > -----Original Message----- > From: Bruce Fitzsimons [mailto:Bruce@REDACTED] > into your .conf file (the values shown are what I > use...YMMV). These options are undocumented as far as I could see - I > spelunked the code. I think the problem has been mentioned > before on this > list though. The max header size defaults to 256. > > Cheers, > Bruce These options are documented. Try erl -man httpd_core cheers, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From rvg@REDACTED Wed Aug 8 13:19:57 2001 From: rvg@REDACTED (Rudolph van Graan) Date: Wed, 8 Aug 2001 13:19:57 +0200 Subject: Problems compiling R7-B on Debian Linux Message-ID: <6CB639EBBEAAD944B178DA06CBE921522B31@BOHR.net.ifoni.com> Hi all, Yesterday, I've tried to compile R7-B on Debian Linux (v2.2) on i386. The ./configure worked well, giving no significant output. However, running make produced the following output: einstein:/usr/local/otp_src_R7B-2# make cd erts && ERL_TOP=/usr/local/otp_src_R7B-2 make NO_START_SCRIPTS=true opt make[1]: Entering directory `/usr/local/otp_src_R7B-2/erts' make[2]: Entering directory `/usr/local/otp_src_R7B-2/erts/emulator' make -f i686-pc-linux-gnu/Makefile TYPE=opt make[3]: Entering directory `/usr/local/otp_src_R7B-2/erts/emulator' make[3]: i686-pc-linux-gnu/Makefile: No such file or directory make[3]: *** No rule to make target `i686-pc-linux-gnu/Makefile'. Stop. make[3]: Leaving directory `/usr/local/otp_src_R7B-2/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/usr/local/otp_src_R7B-2/erts/emulator' Repeated for `/usr/local/otp_src_R7B-2/erts/etc/common' and `/usr/local/otp_src_R7B-2/erts/epmd' I guess it is simply a problem with Makefile, but before I try to figure out what is wrong - has anyone got an idea for a quick fix here? For information: I downloaded otp_src_R7B-2.tar.gz, done a tar xvzf otp_src_R7B-2.tar.gz in /usr/local/ that produced /usr/local/otp_src_R7B-2/ cd /usr/local/otp_src_R7B-2/ make clean ./configure make.. Regards, Rudolph From Sean.Hinde@REDACTED Wed Aug 8 13:51:26 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 8 Aug 2001 12:51:26 +0100 Subject: Problems compiling R7-B on Debian Linux Message-ID: <402DD461F109D411977E0008C791C312039F6274@imp02mbx.one2one.co.uk> Rudolph, > Yesterday, I've tried to compile R7-B on Debian Linux (v2.2) on i386. > The ./configure worked well, giving no significant output. This is the problem - not enough output :) More than likely you need to do ./configure --without-ssl (or supply the ssl libraries) to ensure the configure script runs to the end and produces the makefiles. Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From sam@REDACTED Wed Aug 8 13:55:46 2001 From: sam@REDACTED (Samuel Tardieu) Date: Wed, 8 Aug 2001 13:55:46 +0200 Subject: Problems compiling R7-B on Debian Linux In-Reply-To: <6CB639EBBEAAD944B178DA06CBE921522B31@BOHR.net.ifoni.com> References: <6CB639EBBEAAD944B178DA06CBE921522B31@BOHR.net.ifoni.com> Message-ID: <2001-08-08-13-55-46+trackit+sam@debian.org> On 8/08, Rudolph van Graan wrote: | Yesterday, I've tried to compile R7-B on Debian Linux (v2.2) on i386. | The ./configure worked well, giving no significant output. | | However, running make produced the following output: This may be a stupid question, but why are you not using Debian's precompiled packages for R7-B? Or if you don't want to go to "testing" or "unstable", why not do a: % apt-get source --compile erlang % apt-get install erlang*deb to compile it locally on your box? Sam From kent@REDACTED Wed Aug 8 14:01:34 2001 From: kent@REDACTED (Kent Boortz) Date: 08 Aug 2001 14:01:34 +0200 Subject: Problems compiling R7-B on Debian Linux In-Reply-To: "Rudolph van Graan"'s message of "Wed, 8 Aug 2001 13:19:57 +0200" References: <6CB639EBBEAAD944B178DA06CBE921522B31@BOHR.net.ifoni.com> Message-ID: > make[3]: *** No rule to make target `i686-pc-linux-gnu/Makefile'. Stop. > make[3]: Leaving directory `/usr/local/otp_src_R7B-2/erts/emulator' > make[2]: *** [opt] Error 2 > make[2]: Leaving directory `/usr/local/otp_src_R7B-2/erts/emulator' This is a bug in the configure script. I did in fact fail but continued to process configure for sub directories making it look like a success. This is corrected in "otp_src_R7B-3.tar.gz". For R7B-2 try % ./configure --without-ssl kent From matthias@REDACTED Thu Aug 9 09:49:26 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Thu, 9 Aug 2001 09:49:26 +0200 Subject: Problems with sample httpd setup In-Reply-To: <402DD461F109D411977E0008C791C31205E06058@imp02mbx.one2one.co.uk> References: <402DD461F109D411977E0008C791C31205E06058@imp02mbx.one2one.co.uk> Message-ID: <15218.16518.643362.143344@antilipe.corelatus.se> Hi, Bruce> These options are undocumented as far as I could see Chandrashekhar> These options are documented. Try erl -man httpd_core Are you using the commercial version? As far as I can tell, the open source version's documents haven't been upgraded, e.g. http://www.erlang.org/doc/r7b/lib/inets-2.5.3/doc/html/httpd_core.html describes inets 2.5.3, whereas the version in R7B-3 is 2.5.6. The same problem occurs with the downloadable documentation at http://www.erlang.org/download.html Both the HTML and MAN versions are out of date. Matthias From Chandrashekhar.Mullaparthi@REDACTED Thu Aug 9 09:54:41 2001 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 9 Aug 2001 08:54:41 +0100 Subject: Problems with sample httpd setup Message-ID: <402DD461F109D411977E0008C791C31205E0606B@imp02mbx.one2one.co.uk> Yes - we use the commercial version. Hmm... Chandru > -----Original Message----- > From: matthias@REDACTED [mailto:matthias@REDACTED] > Sent: 9 August 2001 08:49 > To: Chandrashekhar Mullaparthi > Cc: 'Bruce Fitzsimons'; Steve Purcell; erlang-questions@REDACTED > Subject: RE: Problems with sample httpd setup > > > Hi, > > Bruce> These options are undocumented as far as I could see > > Chandrashekhar> These options are documented. Try erl -man httpd_core > > Are you using the commercial version? As far as I can tell, the open > source version's documents haven't been upgraded, e.g. > http://www.erlang.org/doc/r7b/lib/inets-2.5.3/doc/html/httpd_core.html describes inets 2.5.3, whereas the version in R7B-3 is 2.5.6. The same problem occurs with the downloadable documentation at http://www.erlang.org/download.html Both the HTML and MAN versions are out of date. Matthias NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From kent@REDACTED Thu Aug 9 15:22:16 2001 From: kent@REDACTED (Kent Boortz) Date: 09 Aug 2001 15:22:16 +0200 Subject: Problems with sample httpd setup In-Reply-To: matthias@corelatus.com's message of "Thu, 9 Aug 2001 09:49:26 +0200" References: <402DD461F109D411977E0008C791C31205E06058@imp02mbx.one2one.co.uk> <15218.16518.643362.143344@antilipe.corelatus.se> Message-ID: matthias@REDACTED writes: > Both the HTML and MAN versions are out of date. Now the on-line documentation contains all released (R7B commercial) versions of the applications. The manual index and permuted index are not updated. http://www.erlang.org/doc/r7b/doc/ I have not put together a new documentation set but the more up-to-date commercial R7B01 HTML documentation can be downloaded from http://www.erlang.org/download/otp_doc_html_R7B01.tar.gz kent From jasdeep@REDACTED Thu Aug 9 17:41:50 2001 From: jasdeep@REDACTED (Jasdeep) Date: Thu, 9 Aug 2001 21:11:50 +0530 Subject: Can anybody give me example how to frame a MAP message Message-ID: Hi Well i am using map ASN which i picked from 3GPP specs, but whatever is there in Macros in specs, the object is not created. So can anybody tell me how to use Macros to frame the Message. Please can you tell me some links how to make MAP message. Thanks in Advance ======================== Jasdeep Randhawa Software Engineer(ll) IND-TELESOFT PVT LTD, 104,Industrial Estate, 5th Block, Kormangala, Bangalore-95 ph-5521937-40 ext:230 ======================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sean.Hinde@REDACTED Thu Aug 9 19:03:38 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Thu, 9 Aug 2001 18:03:38 +0100 Subject: Can anybody give me example how to frame a MAP message Message-ID: <402DD461F109D411977E0008C791C312039F629B@imp02mbx.one2one.co.uk> Jasdeep, The ASN.1 compiler suppiled with Erlang doesn't support the Macro notation used in MAP. (it is not even in the current ASN.1 standard. I remember reading somewhere that this is because it was deemed too expressive for tools to correctly handle in its full form). I fact you don't need the Macros. All they do for MAP (pretty much) is say which messages are commands and which ones should be received as replies (i.e. success or error). The actual ASN.1 of a location update request for example is simply that of : TCAP Begin Transaction ID App Context TCAP Component portion TCAP Invoke Location Update This immediately follows the SCCP wrapper. There follows a bit of code I once wrote to decode generic ASN.1 so if you have some MAP messages you can easily peer inside. Rgds, Sean %%----------------------------------------------------------------------- %% Decode asn1 coded binary into parse tree %% Handles indefinite length if re-assembly has already been %% done - should be easy to allow for segmented though %% as we keep a count of unrequited indefinite length %% constructor tags. %%----------------------------------------------------------------------- asn1_decode(Bin) -> asn1_decode(Bin, 0). asn1_decode(<<>>, 0) -> []; asn1_decode(Bin, N0) -> {Class, Form, Tag, Rest, N} = get_tag(Bin, N0), case tag_type(Class, Form, Tag) of indefinite_end -> asn1_decode(Rest, N); Constructor when Constructor == set; Constructor == seq; Constructor == constructor -> case get_length(Rest) of {indefinite, Rest1} -> [{{Constructor, indef, Class, Tag}, asn1_decode(Rest1, N+1)}]; {Len, Rest1} -> {Data, Rest2} = get_content(Len, Rest1), [{{Constructor, Class, Tag}, asn1_decode(Data, 0)}| asn1_decode(Rest2, N)] end; tag -> {Len, Rest1} = get_length(Rest), {Data, Rest2} = get_content(Len, Rest1), [{{tag, fmt_class(Class), Tag}, Data}|asn1_decode(Rest2, N)] end. %% Get tag data get_tag(<<0:1, 0:15, Rest/binary>>, 0) -> exit(unexpected_end_of_indefinite_length); get_tag(<<0:1, 0:15, Rest/binary>>, N) -> {indefinite_end, 0, 0, Rest, N-1}; get_tag(<>, N) -> {Tag1, Rest1} = get_tag1(Tag, Rest), {Class, Form, Tag1, Rest1, N}. %% Handle extension parts of the tag field get_tag1(31, <<0:1, Tag:7, Rest/binary>>) -> {Tag, Rest}; get_tag1(31, <<1:1, Msb:7, _:1, Lsb:7, Rest/binary>>) -> {Msb*128+Lsb, Rest}; get_tag1(Tag, Rest) -> {Tag, Rest}. % Do short and long definite length forms % And *now*... indefinite length! get_length(<<0:1, Len:7, Rest/binary>>) -> {Len, Rest}; get_length(<<1:1, 0:7, Rest/binary>>) -> {indefinite, Rest}; get_length(<<1:1, Len_len:7, Rest/binary>>) -> % io:format("Len_len:~p~n",[Len_len]), <> = Rest, {Len, Rest1}. % Get actual content of field get_content(Len, Rest) -> <> = Rest, {Data, Rest1}. % tag_type(Class, Form, Tag) -> tag|seq|set|constructor tag_type(indefinite_end, _, _) -> indefinite_end; tag_type(Class, 0, Tag) -> tag; tag_type(0, 1, 16) -> seq; tag_type(0, 1, 17) -> set; tag_type(Class, 1, Els) -> constructor. fmt_class(0) -> univ; fmt_class(1) -> app; fmt_class(2) -> context; fmt_class(3) -> priv. -----Original Message----- From: Jasdeep [mailto:jasdeep@REDACTED] Sent: 09 August 2001 16:42 To: 'erlang-questions@REDACTED' Subject: Can anybody give me example how to frame a MAP message Hi Well i am using map ASN which i picked from 3GPP specs, but whatever is there in Macros in specs, the object is not created. So can anybody tell me how to use Macros to frame the Message. Please can you tell me some links how to make MAP message. Thanks in Advance ======================== Jasdeep Randhawa Software Engineer(ll) IND-TELESOFT PVT LTD, 104,Industrial Estate, 5th Block, Kormangala, Bangalore-95 ph-5521937-40 ext:230 ======================= NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From garry@REDACTED Thu Aug 9 19:54:06 2001 From: garry@REDACTED (Garry Hodgson) Date: Thu, 09 Aug 2001 13:54:06 -0400 Subject: how to kill a port's external process? References: <200107230056.UAA64560@sprache.sage.att.com> <3B5FC327.3D2E2EBD@catseye.mb.ca> Message-ID: <3B72CE3E.AF27FE73@sage.att.com> Chris Pressey wrote: > "Garrett G. Hodgson" wrote: > > i'm building a little gui wrapper around a command line audio player. > > i've got an erlang process that calls open_port() to spawn the external > > player, but it doesn't actually send/receive anything to it over stdio. > > I don't think the port mechanism was ever intended to be used that way > :) yeah, well, i live to abuse language features. ... > So the port terminates when the read_cmd() function detects end-of-file > from the Erlang side of things (AFAICT.) > > Do you have the source to the external program? It might help to > rewrite the main body to listen to the Erlang ports mechanism, even if > there's no established interface. alas, i do not. > This goes beyond Erlang, but... killing a process based on the name > of a program is always dodgy at best, given that a program can change > what it shows up as in 'ps'. in this case, the external program does not. i've gotten it working using this hack, and it works just fine for my purposes. i expect i'll let it be. thanks to all for the information and tips. -- Garry Hodgson sometimes we ride on your horses Senior Hacker sometimes we walk alone Software Innovation Services sometimes the songs that we hear AT&T Labs are just songs of our own garry@REDACTED From luke@REDACTED Thu Aug 9 20:35:21 2001 From: luke@REDACTED (Luke Gorrie) Date: 09 Aug 2001 20:35:21 +0200 Subject: how to kill a port's external process? In-Reply-To: <3B72CE3E.AF27FE73@sage.att.com> References: <200107230056.UAA64560@sprache.sage.att.com> <3B5FC327.3D2E2EBD@catseye.mb.ca> <3B72CE3E.AF27FE73@sage.att.com> Message-ID: Garry Hodgson writes: > > This goes beyond Erlang, but... killing a process based on the name > > of a program is always dodgy at best, given that a program can change > > what it shows up as in 'ps'. > > in this case, the external program does not. i've gotten it working > using this hack, and it works just fine for my purposes. i expect i'll > let it be. I think a really nice and manly way to kill external ports would be to hack the "spawn driver" so that Erlang could make a driver ioctl to send a signal to a spawned program. I think that's actually pretty straight forward - with some help I've added an ioctl function to the spawn driver which I use to close Erlang's sending pipe to a spawned program without closing the reading one. I've attached a patch which should be mostly reusable. The file to hack is erts/emulator/sys/unix/sys.c If you hack that then you can then use erlang:port_command/2 to send a message to the driver (erlang sends an I/O list, driver gets it as a char*) and it can arbitrarily interpret that, e.g as: <> I for one would cheer if someone were to do this :-) with just a few spawn driver ioctls we could make a unix command shell in erlang. Then you could annoy both bash and tcsh people when they use your computer ;-) -------------- next part -------------- A non-text attachment was scrubbed... Name: sys.patch Type: text/x-patch Size: 2693 bytes Desc: spawn driver ioctl patch URL: From luke@REDACTED Thu Aug 9 21:32:20 2001 From: luke@REDACTED (Luke Gorrie) Date: 09 Aug 2001 21:32:20 +0200 Subject: how to kill a port's external process? In-Reply-To: References: <200107230056.UAA64560@sprache.sage.att.com> <3B5FC327.3D2E2EBD@catseye.mb.ca> <3B72CE3E.AF27FE73@sage.att.com> Message-ID: Luke Gorrie writes: > The file to hack is erts/emulator/sys/unix/sys.c > > If you hack that then you can then use erlang:port_command/2 to send a > message to the driver (erlang sends an I/O list, driver gets it as a > char*) and it can arbitrarily interpret that, e.g as: I lie: it's port_control. -Luke From luke@REDACTED Thu Aug 9 23:23:27 2001 From: luke@REDACTED (Luke Gorrie) Date: 09 Aug 2001 23:23:27 +0200 Subject: how to kill a port's external process? In-Reply-To: References: <200107230056.UAA64560@sprache.sage.att.com> <3B5FC327.3D2E2EBD@catseye.mb.ca> <3B72CE3E.AF27FE73@sage.att.com> Message-ID: Luke Gorrie writes: > I think a really nice and manly way to kill external ports would be to > hack the "spawn driver" so that Erlang could make a driver ioctl to > send a signal to a spawned program. I couldn't resist and hacked in support for doing kill(2) on port programs. I don't know if the approach is unwise for some reason but it seems to work nicely. The interface is a "spawn_drv" module in the kernel application with these functions: %% close_output(Port) -> ok | {error, Reason} %% %% Close the pipe from Erlang to the port's stdin %% send_signal(Port, Signal) -> ok | {error, Reason} %% Signal = hup | kill | term %% %% Send a Unix signal to the port with kill(2) I was lazy and just defined 3 signals, but it's easy to add more. Example: 1> P = erlang:open_port({spawn, "/bin/cat"}, [exit_status]). #Port<0.7> 2> flush(). ok 3> spawn_drv:send_signal(P, kill). ok 4> flush(). Shell got {#Port<0.7>,{exit_status,137}} ok Patch against R7B-3 attached, I hope I built it properly. -------------- next part -------------- A non-text attachment was scrubbed... Name: spawndrv.patch Type: text/x-patch Size: 5842 bytes Desc: not available URL: From gupta@REDACTED Fri Aug 10 16:54:01 2001 From: gupta@REDACTED (Gopal Gupta) Date: Fri, 10 Aug 2001 09:54:01 -0500 Subject: PADL'02: Deadline extension Message-ID: <200108101454.f7AEs1Q06446@herbrand.utdallas.edu> Due to a number of requests, the deadline for PADL'02 submission is extended to Aug 20th. This is a firm deadline, and will not change. The call for papers and details, including submission procedure, for the 4th International Symposium on Practical Aspects of Declarative Languages can be found at: http://www.cs.sunysb.edu/~padl2002/ I apologize for the multiple messages, I have no control over it. Gopal Gupta http://www.utdallas.edu/~gupta From martin@REDACTED Fri Aug 10 20:23:59 2001 From: martin@REDACTED (Martin J. Logan) Date: Fri, 10 Aug 2001 13:23:59 -0500 Subject: HTTP @ CGI invocation in Erlang. References: <14903.22238.596613.849064@sagesse.ird.idealx.com> Message-ID: <3B7426BF.DD08A724@vailsys.com> Hi, I receive a url and some cgi args in an erlang process. I must invoke the cgi with the args supplied. I was wondering if anyone knows how to perform these type of http requests in erlang. Cheers, Martin From Sean.Hinde@REDACTED Fri Aug 10 20:47:36 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 10 Aug 2001 19:47:36 +0100 Subject: HTTP @ CGI invocation in Erlang. Message-ID: <402DD461F109D411977E0008C791C312039F62AD@imp02mbx.one2one.co.uk> > Hi, > I receive a url and some cgi args in an erlang process. I > must invoke the cgi with the args supplied. > I was wondering if anyone knows how to perform these type of > http requests in erlang. > Cheers, > Martin There are a couple of contribs and examples at www.erlang.org showing how to go about retrieving web pages. You could start with these: http://www.erlang.org/user.html#www_tools-1.0 and http://www.erlang.org/examples/small_examples/index.html#1 Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From bruce@REDACTED Mon Aug 13 07:03:04 2001 From: bruce@REDACTED (Bruce Fitzsimons) Date: Mon, 13 Aug 2001 17:03:04 +1200 Subject: Erlang Process Limits Message-ID: <088901c123b5$3c0c5b20$5f00a8c0@SLANT> Hello again, Is the maximum number of processes on an Erlang node a hard limit, or is there the potential for this to be increased (beyond 32767)? I am aware that requiring such a huge number may be an indicator that I should rethink my design, but it just maps cleanly to having 1 process for every call, with a parent process to manage them(2+ calls per real call). However this limits me to only 10000 simultaneous calls, which isn't that much for my application. Is there any other way I can get around this limit without going to multiple nodes? Your suggestions would be welcome. Cheers, Bruce From raimo@REDACTED Mon Aug 13 09:57:44 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Mon, 13 Aug 2001 09:57:44 +0200 Subject: Erlang Process Limits References: <088901c123b5$3c0c5b20$5f00a8c0@SLANT> Message-ID: <3B778878.42C4B478@erix.ericsson.se> Bruce Fitzsimons wrote: > > Hello again, > > Is the maximum number of processes on an Erlang node a hard limit, or is > there the potential for this to be increased (beyond 32767)? > It is a fairly hard limit since in the internal representation of a pid, 15 bits are used for the process table index on the node, and all other bits are also used for essential things. This applies at least for the Beam virtual machine up to release R8. We may change the internal representation in future releases due to other reasons as well, but no guarantees..., and in that case this limit might be raised, as well as when a port to a 64 bit host processor comes. > I am aware that requiring such a huge number may be an indicator that I > should rethink my design, but it just maps cleanly to having 1 process for > every call, with a parent process to manage them(2+ calls per real call). > However this limits me to only 10000 simultaneous calls, which isn't that > much for my application. > > Is there any other way I can get around this limit without going to multiple > nodes? > I heard a customer that found that the scheduler became too sluggish when they had a similar solution, so they changed their design to increase performance, not because they had hit the number of processes limit. They found that not all calls were always particulary active, so during idle states in the call lifetime they save the process state into an ets table and stops the process. Their manager process then detects if something happens on such a call, spawns a new process (processes are cheap to spawn) and gives it the saved state. / Raimo Niskanen, Erlang/OTP, Ericsson UAB From etxuwig@REDACTED Mon Aug 13 10:13:51 2001 From: etxuwig@REDACTED (Ulf Wiger) Date: Mon, 13 Aug 2001 10:13:51 +0200 (MET DST) Subject: Erlang Process Limits In-Reply-To: <088901c123b5$3c0c5b20$5f00a8c0@SLANT> Message-ID: On Mon, 13 Aug 2001, Bruce Fitzsimons wrote: >Hello again, > >Is the maximum number of processes on an Erlang node a hard >limit, or is there the potential for this to be increased >(beyond 32767)? I don't know that this has been tested. >I am aware that requiring such a huge number may be an >indicator that I should rethink my design, but it just maps >cleanly to having 1 process for every call, with a parent >process to manage them(2+ calls per real call). However this >limits me to only 10000 simultaneous calls, which isn't that >much for my application. I suggest you look at the dispatcher user contrib. It is similar to the solution used in AXD 301, where we have verified that we can handle some 100,000 calls per call handling processor (I am not up to date with the actual number.) We actually have two processes per call (A- and B-side, what's called a half-call model.) I have a newer version, dispatcher-1.1, which is more efficient, and also provides an improved framework. If you are interested, I could clean it up[*] and publish it. The idea of the dispatcher solution is that when handling calls (establishing sessions of some sort), there is usually only activity in the beginning and at the end of each call. In the meantime, it's more efficient to store the call state in ETS, than keeping one or two process(es) for each. The overhead is slight, as long as each call activity takes at least a few milliseconds. There are actually a couple of other advantages to the model: - The "call process" can be implemented as a bare-bones FSM, which is probably the most beautiful state machine programming model around. Since the process is short lived, it doesn't have to worry about supporting upgrade etc. - The heap size of the process can be set very high, allowing you to short-circuit the GC. /Uffe [*] I had been playing with the type checker, and created type specifications for the dispatcher modules. I don't remember what state they were in. Also, I had apparently cheated on the upgrade support for the dispatcher process -- unforgivable. -- Ulf Wiger tfn: +46 8 719 81 95 Senior System Architect mob: +46 70 519 81 95 Strategic Product & System Management ATM Multiservice Networks Data Backbone & Optical Services Division Ericsson Telecom AB From complog@REDACTED Tue Aug 14 08:34:59 2001 From: complog@REDACTED (Logic Programming Rsrch Association) Date: Tue, 14 Aug 2001 00:34:59 -0600 Subject: CICLOPS'01 -- Call for Papers Message-ID: <200108140634.f7E6YxY05404@pippo.cs.nmsu.edu> ======================================================================== We apologize for multiple copies of this mail / posting ======================================================================== Post-Conference Workshop CICLOPS 2001 Colloquium on Implementation of Constraint and LOgic Programming Systems held in conjunction with the International Conference on Logic Programming and International Conference on Principles and Practice of Constraint Programming Paphos, Cyprus December 1, 2001 ======================================================================== see also: http://www.cs.nmsu.edu/~complog/conferences/ciclops01 ======================================================================== This workshop is a continuation of the series of workshops on Implementations of Logic Programming Systems, previously held with considerable success in Budapest (1993), Santa Margherita (1994) and Ithaca (1994), as well as the Compulog Net workshops on Parallelism and Implementation Technologies held in Madrid (1993-4), Utrecht (1995), Bonn (1996), Port Jefferson (1997), Manchester (1998), Las Cruces (1999), and London (2000). This year, the event will join forces with TRICS (Techniques for Implementing Constraint Programming Systems), previously held in Singapore (2000), thus providing coverage to implementation technology for both Logic and Constraint Programming. The last years have seen continuous progress in the computing technology available both for the academic and commercial computing environments. Examples include improved processor performance, increased memory capacity and bandwidth, faster networking technology, and Operating System support for cluster computing. Combined with recent advances in compilation technologies, these improvements are causing high-level languages to be regarded as good candidates for programming complex, real world applications. Logic Programming and Constraint Programming, in particular, seem to offer one of the best alternatives, as they couple a very high level of abstraction and a declarative nature with an extreme flexibility in the design of its execution model. The main intent of this workshop is to bring together, in an informal and friendly setting, key researchers on implementation technologies for logic and constraint-based languages and systems, in order to promote a much needed exchange of ideas and feedback on recent developments. The workshop is focused on design and implementation of logic and constraint programming systems whether sequential, parallel, or concurrent. Preference will be given to the analysis and description of implemented systems (or systems currently under implementation) and their associated techniques, problems found in their development or design, and steps taken towards the solution of these problems. Suggested topics of interest include, but are not limited to: - standard and non-standard implementation schemes e.g. modification of WAM, translation to C, native-code generation etc. - optimizing compilers and static analysis - parallelism and concurrency - techniques for the implementation of different extensions of logic and constraint programming, e.g., multi-paradigm languages and systems, non-monotonic reasoning systems, inductive logic programming - benchmarking and performance evaluation - Software design aspects of LP/CP systems: components, patterns, etc. - memory management and garbage collection - programming environments - tools for internet applications - experiences from using systems in real-life applications Contributions: -------------- Authors are invited to submit papers written in English and not exceeding 12 pages (10pts Font, letter-size paper, 1 inch margin). To speed up the process of refereeing, authors are requested to submit their paper in Postscript or PDF form by electronic mail to the workshop coordinator (e-mail address below). Conventional paper copies may be sent to the contact address below only if access to electronic media is not available. Submissions should contain full return mail and email address (if applicable), and FAX number (if applicable) of the contact author. Prospective authors are kindly requested to first send an indication of interest together with a paper title to the organizers. Deadline for submissions is September 5, 2001. Authors submitting by electronic mail will receive an acknowledgement (also by electronic mail) within 2-3 days. Accepted papers: ---------------- Submitted papers will be reviewed by at least two referees. Authors will be notified of the acceptance of their papers by September 23, 2001. To be included in the workshop proceedings (to be distributed to the workshop participants), revised versions of the accepted papers must be sent no later than October 5, 2001. Electronic versions of the accepted papers will be also made available through the workshop's homepage. Workshop Chairs: ---------------- I. Dutra (Federal University of Rio de Janeiro, Brazil) M. Henz (National University of Singapore, Singapore) Program committee: ------------------ M. Carro (Politechnic Univ. of Madrid, Spain) M. Carlsson (SICS, Sweden) B. Demoen (K.U. Leuven, Belgium) G. Gupta (Univ. of Texas at Dallas, USA) F. Laburthe (Bouygues E-lab, France) I. Niemela (Helsinki University of Technology, Finland) E. Pontelli (New Mexico State University, USA) V. Santos Costa (Federal University of Rio de Janeiro, Brazil) C. Schulte (Universitat des Saarlandes, Germany) F. Silva (Univ. of Porto, Portugal) Important dates: ---------------- Indication of interest: as soon as possible Submission of papers: September 5, 2001 Notification of authors: September 23, 2001 Final version sent by: October 5, 2001 ICLP'01 Conference: Nov. 26 - Dec. 1, 2001 Workshop: December 1, 2001 Contact address for Workshop Coordinator: ----------------------------------------- Enrico Pontelli Dept. Computer Science New Mexico State University Box 30001/CS, Las Cruces, NM 88003 Phone: +1 (505) 646-6239 FAX: +1 (505) 646-1002 email: epontell@REDACTED Workshop Web Site: ------------------ http://www.cs.nmsu.edu/~complog/conferences/ciclops01 ======================================================================== From dsolaz@REDACTED Tue Aug 14 00:08:52 2001 From: dsolaz@REDACTED (Daniel Solaz) Date: Tue, 14 Aug 2001 00:08:52 +0200 Subject: how to read from a TCP socket line by line Message-ID: <01080708440700.00409@meduz.dnet.org> Hello. How does one do when there's the need to read from a TCP socket line by line? I've been looking through the docs but found nothing. Something like this would be nice: {ok, Socket} = gen_tcp:connect(...), Line = io:get_line(Socket, ...) Maybe I should look at how the inets webserver parses HTTP headers (which BTW is exactly what I want to do, except on the client side). -- d s o l a z @ L E P I D O P T E R O . C O M From luke@REDACTED Tue Aug 14 15:33:26 2001 From: luke@REDACTED (Luke Gorrie) Date: 14 Aug 2001 15:33:26 +0200 Subject: how to read from a TCP socket line by line In-Reply-To: <01080708440700.00409@meduz.dnet.org> References: <01080708440700.00409@meduz.dnet.org> Message-ID: Daniel Solaz writes: > Hello. > > How does one do when there's the need to read from a TCP socket line by > line? I've been looking through the docs but found nothing. > > Something like this would be nice: > > {ok, Socket} = gen_tcp:connect(...), > Line = io:get_line(Socket, ...) > > Maybe I should look at how the inets webserver parses HTTP headers > (which BTW is exactly what I want to do, except on the client side). You can use the [{packet, line}] option in gen_tcp:connect/3. For example: 1> gen_tcp:connect("mail", 25, [{packet, line}, {active, true}]). {ok,#Port<0.8>} 2> flush(). Shell got {tcp,#Port<0.8>, "220 sharks.alteon.com ESMTP Sendmail 8.11.3/8.11.3; Tue, 14 Aug 2001 06:30:31 -0700 (PDT)\r\n"} ok I think this was added somewhat recently, but it looks like it's there in R7B. Cheers, Luke From tobbe@REDACTED Tue Aug 14 16:32:43 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 14 Aug 2001 16:32:43 +0200 Subject: New release: btt-3.0 Message-ID: JFYI: The Bluetail Ticket Tracker has now been completely moved to sourceforge, and a new release has just been uploaded (btt-3.0) at: http://sourceforge.net/projects/btt/ Cheers /Tobbe From snickl@REDACTED Tue Aug 14 16:39:23 2001 From: snickl@REDACTED (snickl@REDACTED) Date: Tue, 14 Aug 2001 16:39:23 +0200 (CEST) Subject: how to read from a TCP socket line by line In-Reply-To: <01080708440700.00409@meduz.dnet.org> Message-ID: On Tue, 14 Aug 2001, Daniel Solaz wrote: > Maybe I should look at how the inets webserver parses HTTP headers > (which BTW is exactly what I want to do, except on the client side). In this case, you should check out http://www.erlang.org/contrib/www_tools-1.0.tgz CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From dsolaz@REDACTED Tue Aug 14 23:55:54 2001 From: dsolaz@REDACTED (Daniel Solaz) Date: Tue, 14 Aug 2001 23:55:54 +0200 Subject: how to read from a TCP socket line by line In-Reply-To: References: <01080708440700.00409@meduz.dnet.org> Message-ID: <01081423555401.00452@meduz.dnet.org> On Tuesday 14 August 2001 15:33 Luke Gorrie wrote: > You can use the [{packet, line}] option in gen_tcp:connect/3. > ... > I think this was added somewhat recently, but it looks like it's > there in R7B. Ah yes, now I see it in the docs, but they say: "line mode, a packet is a line terminated with newline, lines longer than the receive buffer are truncated" What does the last part mean? If "truncated" means what I think it means, how do I ensure my buffer is large enough when reading binary data? Note that after reading the HTTP response header line by line I should switch to buffer mode (using gen_tcp:recv/3), since the response body may be binary data. In Modula-3 I've solved this using "read one line" and "read one buffer" methods on the same reader. But in Erlang it seems I either open the socket in active mode and get lines as messages, or open the socket in passive mode and get buffers. -- d s o l a z @ L E P I D O P T E R O . C O M From luke@REDACTED Wed Aug 15 17:30:58 2001 From: luke@REDACTED (Luke Gorrie) Date: 15 Aug 2001 17:30:58 +0200 Subject: how to read from a TCP socket line by line In-Reply-To: <01081423555401.00452@meduz.dnet.org> References: <01080708440700.00409@meduz.dnet.org> <01081423555401.00452@meduz.dnet.org> Message-ID: Daniel Solaz writes: I got tips and tricks for these, curtesy of tony rogvall: > Ah yes, now I see it in the docs, but they say: > "line mode, a packet is a line terminated with newline, lines longer > than the receive buffer are truncated" > > What does the last part mean? If "truncated" means what I think it > means, how do I ensure my buffer is large enough when reading binary > data? You can use the {buffer, ByteSize} option when opening the socket to say how long the buffer should be. If a line is longer than that, then you'll get it in several parts (only the last containing a newline). So for long lines maybe you'll need to concatenate them yourself, I'm not sure if there's a practical limit on the socket buffer size. > Note that after reading the HTTP response header line by line I should > switch to buffer mode (using gen_tcp:recv/3), since the response body > may be binary data. > > In Modula-3 I've solved this using "read one line" and "read one > buffer" methods on the same reader. But in Erlang it seems I either > open the socket in active mode and get lines as messages, or open the > socket in passive mode and get buffers. You can do packet-based reads both as messages and with gen_tcp:recv. The trick with recv is to have the socket in packet mode, and pass a length of 0. Here's an example, using a buffer size too small to get the whole line: 13> {ok, S} = gen_tcp:connect("mail.bluetail.com", 25, [{active, false}, {packet, line}, {buffer, 40}]). {ok,#Port<0.10>} 14> gen_tcp:recv(S, 0). {ok,"220 mail.bluetail.com ESMTP BLUETAIL Mai"} 15> gen_tcp:recv(S, 0). {ok,"l Robustifier (2.2.2/3.1.2); Wed, 15 Aug"} 16> gen_tcp:recv(S, 0). {ok," 2001 17:16:59 +0200\r\n"} When you've finished reading the headers, you can take the socket out of line mode with: inet:setopts(S, [{packet, raw}]) Then you can read the body. There are also some nifty tricks in the inet module: You can find out the default/current settings for a socket, e.g: 32> {ok, S} = gen_tcp:connect("mail.bluetail.com", 25, []). {ok,#Port<0.14>} 33> inet:getopts(S, [buffer, active, packet]). {ok,[{buffer,1024},{active,true},{packet,0}]} If you want to see all options, then you can call inet:options() to get the complete list and pass that in for the second argument of getopts/2. Another nice thing is inet:i() which is like a "netstat" for erlang showing all open sockets: 35> inet:i(). Port Module Recv Sent Owner Local Address Foreign Address State 13 inet_tcp 0 0 <0.54.0> 192.168.128.43:4371 192.168.128.251:smtp CONNECTED 14 inet_tcp 102 0 <0.54.0> 192.168.128.43:4373 192.168.128.251:smtp CONNECTED Port Module Recv Sent Owner Local Address Foreign Address State ok From Sean.Hinde@REDACTED Wed Aug 15 17:44:37 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 15 Aug 2001 16:44:37 +0100 Subject: Driver question Message-ID: <402DD461F109D411977E0008C791C312039F62D4@imp02mbx.one2one.co.uk> Hi, I want to do someting like this: Allocate some storage in my driver, pass the data to erlang, and then, if the data goes out of scope at an erlang level have the storage automatically freed out of the driver by garbage collection. Maybe driver binaries exhibit this effect already? Or do they need to be freed in the driver as well as Erlang? There is a part of the inet_drv where the refc value of the binary is checked to see if anyone else still needs it, which then frees it if no-one else does, but this still implies some cleanup routine run regularly in the driver. Thoughts anyone? Is it a sensible thing to try to do? Thanks, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From raimo@REDACTED Wed Aug 15 19:12:28 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 15 Aug 2001 19:12:28 +0200 Subject: Driver question References: <402DD461F109D411977E0008C791C312039F62D4@imp02mbx.one2one.co.uk> Message-ID: <3B7AAD7C.E7C02D2@erix.ericsson.se> Sean Hinde wrote: > > Hi, > > I want to do someting like this: > > Allocate some storage in my driver, pass the data to erlang, and then, if > the data goes out of scope at an erlang level have the storage automatically > freed out of the driver by garbage collection. > > Maybe driver binaries exhibit this effect already? Or do they need to be > freed in the driver as well as Erlang? > Yes they do. They might be exactly what you need. The driver binaries are reference counted, and when you call driver_allocate_binary(), refcnt is set to 1 (only the driver is holding the binary). When you later call driver_output_binary(), refcnt is incremented to 2, and note that the driver must not change the contents from now on, since erlang processes now can see the data and depend on this. The driver migth as well call driver_free_binary(), which just decrements refcnt. Only when refcnt decrements to 0, the binary is actually freed. Every erlang process that now receives the binary will increment refcnt, and when the binary is garbage collected and found to be unused refcnt is decremented and finaly freed by the last erlang processe that garbage collects it. A driver that implements the outputv() callback receives binaries in an ErlIOVec. When it does not need the data anymore, driver_free_binary must be used to free the binaries, or if driver_enq(), driver_deq() and related (the queue interface) are used, they take care of the refcnt and freeing. > There is a part of the inet_drv where the refc value of the binary is > checked to see if anyone else still needs it, which then frees it if no-one > else does, but this still implies some cleanup routine run regularly in the > driver. > I guess that the trick in inet_drv is about reusing a buffer that has not been sent to erlang, instead of actually freeing the memory and then allocating a new buffer, which is rather expensive. / Raimo Niskanen, Erlang/OPT, Ericsson UAB From luke@REDACTED Mon Aug 20 17:41:04 2001 From: luke@REDACTED (Luke Gorrie) Date: 20 Aug 2001 17:41:04 +0200 Subject: tab completion in inferior erlang Message-ID: Hio, Has anyone managed to get tab-completion to work in the inferior Erlang shell in emacs? I can't quite make it happen. (It may come as news to some people that the erlang shell has tab completion - it took a year and a half for me to find out, because I always used it in emacs :-)) Also a couple of random notes: I (setq comint-process-echoes t) to avoid having my input echoed at me in the buffer. If you try inferior erlang under emacs 21 then you can hack erlang.el's "inferior-erlang-wait-prompt" by changing (beginning-of-line) to (search-backward-regexp "^") to avoid it always thinking the shell is busy. Emacs 21's comint mode uses some magic "fields" so the beginning-of-line isn't where you might think it is. Cheers, Luke From bjarne@REDACTED Mon Aug 20 18:52:17 2001 From: bjarne@REDACTED (Bjarne =?iso-8859-1?Q?D=E4cker?=) Date: Mon, 20 Aug 2001 18:52:17 +0200 Subject: Erlang workshop in Florence on September 2 References: Message-ID: <3B814041.78ABD015@erix.ericsson.se> Dear Erlang Friends Just a remainder of the Erlang Workshop in Florence on September 2 http://www.erlang.se/workshop/ prior to the PLI'2001 (Principles, Logics, and Implementations of High-level Programming Languages) http://music.dsi.unifi.it/pli01/ Best wishes Bjarne D?cker From Sean.Hinde@REDACTED Mon Aug 20 21:07:20 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Mon, 20 Aug 2001 20:07:20 +0100 Subject: When to free the desc in a multithreaded driver Message-ID: <402DD461F109D411977E0008C791C312039F62F9@imp02mbx.one2one.co.uk> Hi, Looking at the file driver, efile_drv.c, I can't quite determine when the port descriptor gets freed. In the file_stop() callback, which I have attached below, the desc gets freed if the fd is zero or the file is compressed, but if the fd is not zero then an invoke_close callback is scheduled. I can't then see anywhere else that the desc gets freed. Two questions arise: 1. If the driver stop callback invokes a function in a thread when should the descriptor be freed? 2. Depending on the answer to 1, is there therefore a memory leak in efile_drv? Thanks, Sean ---------------------------------------------- static int file_stop(desc) file_descriptor* desc; { int fd = desc->fd; if (desc->flags & EFILE_COMPRESSED) { gzclose((gzFile)fd); } else if (fd >= 0) { #if 0 efile_closefile(fd); #else /* Threaded close */ { struct t_data *d = sys_alloc(sizeof(struct t_data)); d->fd = fd; d->command = FILE_CLOSE; DRIVER_ASYNC(2, desc, KEY, invoke_close, (void *) d, free_data); return 0; } #endif } sys_free(desc); return 0; } NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From martin@REDACTED Tue Aug 21 23:03:05 2001 From: martin@REDACTED (Martin J. Logan) Date: Tue, 21 Aug 2001 16:03:05 -0500 Subject: Driver question References: <402DD461F109D411977E0008C791C312039F62D4@imp02mbx.one2one.co.uk> Message-ID: <3B82CC89.1723775A@vailsys.com> Hello, I have two questions. I would like to do sone parsing of data. What is the best way to do this? I have an integer and I would like to make sure that is is a particular length and that it is comprised entirly of digits. I have looked at io_lib and a number of other spots but havent really found anything too elegant. Everything seems to involve converting to strings or using large function gaurds. If this is the way to go I will, but if anyone has a better idea I would like to know. I am always parsing packets in erlang so any info on that in general would be nice. I have an application running that emails the interested parties when it goes down. I have accomplished this in a way that I think is rather kludgy. I use a linked process that traps exit signals from my main supervisor. I was wondering if there is a call back that is called during the shutdown sequence of the app that I could use to make sure that the email is sent on the death of the app. If anyone has nice solutions to either of these problems please let me know. Cheers, Martin From Sean.Hinde@REDACTED Wed Aug 22 00:02:37 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 21 Aug 2001 23:02:37 +0100 Subject: Driver question Message-ID: <402DD461F109D411977E0008C791C312039F630A@imp02mbx.one2one.co.uk> Hi, > I would like to do sone parsing of data. What is the best > way to do this? I > have an integer and I would like to make sure that is is a > particular length > and that it is comprised entirly of digits. I have looked at > io_lib and a > number of other spots but havent really found anything too > elegant. Everything > seems to involve converting to strings or using large > function gaurds. If this > is the way to go I will, but if anyone has a better idea I > would like to know. > I am always parsing packets in erlang so any info on that in > general would be > nice. I'm not sure quite what you are getting at here. If it is an integer then I don't see how it can contain anything other than digits. If you have it as a list (e.g [0,0,1,2,3]) the best solution I have come up with is to convert it to ascii representation and use the BIF list_to_integer("00123"). I agree it isn't really that pretty. For just about every other kind of packet parsing the bit syntax is just too cool for words. > I have an application running that emails the interested > parties when it > goes down. I have accomplished this in a way that I think is > rather kludgy. I > use a linked process that traps exit signals from my main > supervisor. I was > wondering if there is a call back that is called during the > shutdown sequence > of the app that I could use to make sure that the email is > sent on the death of > the app. We usually send out an SNMP trap when apps die. There is a callback provided for exactly this in the standard application template provided in the emacs mode (included below). Cheers, Sean -module(test). -author('shinde@REDACTED'). %%-compile(export_all). %%-export([Function/Arity, ...]). -behaviour(application). %% application callbacks -export([start/2, stop/1]). %%%---------------------------------------------------------------------- %%% Callback functions from application %%%---------------------------------------------------------------------- %%---------------------------------------------------------------------- %% Func: start/2 %% Returns: {ok, Pid} | %% {ok, Pid, State} | %% {error, Reason} %%---------------------------------------------------------------------- start(Type, StartArgs) -> case 'TopSupervisor':start_link(StartArgs) of {ok, Pid} -> {ok, Pid}; Error -> Error end. %%---------------------------------------------------------------------- %% Func: stop/1 %% Returns: any %%---------------------------------------------------------------------- stop(State) -> send_email_from_here(State), ok. NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From euskcj@REDACTED Wed Aug 22 00:37:21 2001 From: euskcj@REDACTED (Kent Johnson) Date: Tue, 21 Aug 2001 17:37:21 -0500 Subject: Binary Matching Message-ID: <3B82E2A1.AAE2DE23@exu.ericsson.se> Does the following code result in a memory copy. parse(<>) -> %% Do any parsing required parse(Rest); parse(<<>>) -> ok. Thanks, Kent From raimo@REDACTED Wed Aug 22 08:45:10 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 22 Aug 2001 08:45:10 +0200 Subject: Binary Matching References: <3B82E2A1.AAE2DE23@exu.ericsson.se> Message-ID: <3B8354F6.201E0138@erix.ericsson.se> Kent Johnson wrote: > > Does the following code result in a memory copy. > > parse(<>) -> > %% Do any parsing required > parse(Rest); > parse(<<>>) -> > ok. > No, not really. For every recursion one new sub-binary will be created and one will become garbage. The sub-binary is a header of a few words that shares contents with the original binary to parse. / Raimo Niskanen, Erlang/OTP, Ericsson UAB. From raimo@REDACTED Wed Aug 22 13:59:05 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Wed, 22 Aug 2001 13:59:05 +0200 Subject: When to free the desc in a multithreaded driver References: <402DD461F109D411977E0008C791C312039F62F9@imp02mbx.one2one.co.uk> Message-ID: <3B839E89.446783D8@erix.ericsson.se> Sean Hinde wrote: > > Hi, > > Looking at the file driver, efile_drv.c, I can't quite determine when the > port descriptor gets freed. > > In the file_stop() callback, which I have attached below, the desc gets > freed if the fd is zero or the file is compressed, but if the fd is not zero > then an invoke_close callback is scheduled. I can't then see anywhere else > that the desc gets freed. > > Two questions arise: > > 1. If the driver stop callback invokes a function in a thread when should > the descriptor be freed? > The descriptor should be freed in the driver stop callback. When the async operation is finished, the driver async_ready callback cannot be called since the port has been closed, so the free_data function is called to free the thread specific data. This is tricky programming. It is much nicer to avoid starting async requests in the driver stop callback. > 2. Depending on the answer to 1, is there therefore a memory leak in > efile_drv? > Yes. This is already corrected in the coming R8 release, and we are working on a patch for R7B shortly. / Raimo Niskanen, Erlang/OTP, Ericsson UAB > > ---------------------------------------------- > static int file_stop(desc) > file_descriptor* desc; > { > int fd = desc->fd; > > if (desc->flags & EFILE_COMPRESSED) { > gzclose((gzFile)fd); > } else if (fd >= 0) { > #if 0 > efile_closefile(fd); > #else > /* Threaded close */ > { > struct t_data *d = sys_alloc(sizeof(struct t_data)); > d->fd = fd; > d->command = FILE_CLOSE; > DRIVER_ASYNC(2, desc, KEY, invoke_close, (void *) d, > free_data); > return 0; > } > #endif > } > sys_free(desc); > return 0; > } > From Mark.Corkery@REDACTED Wed Aug 22 14:59:08 2001 From: Mark.Corkery@REDACTED (Mark Corkery) Date: Wed, 22 Aug 2001 13:59:08 +0100 Subject: OTP R5B & OTP R7B Message-ID: <3B83AC9C.791CF833@eei.ericsson.se> Hi, I've got two remote systems, one based on R5B and another based on R7B. I want to tell which is which from a central R6B machine. How can I do this (taking into account the fact that the R5B machine code cannot be updated). /Mark P.S. is there a better way than erl -version??? -------------- next part -------------- A non-text attachment was scrubbed... Name: Mark.Corkery.vcf Type: text/x-vcard Size: 257 bytes Desc: Card for Mark Corkery URL: From snickl@REDACTED Wed Aug 22 15:26:52 2001 From: snickl@REDACTED (snickl@REDACTED) Date: Wed, 22 Aug 2001 15:26:52 +0200 (CEST) Subject: Anticipating R8 / Was: Re: When to free the desc in a multithreaded driver In-Reply-To: <3B839E89.446783D8@erix.ericsson.se> Message-ID: On Wed, 22 Aug 2001, Raimo Niskanen wrote: > Yes. This is already corrected in the coming R8 release, and we are > working on a patch for R7B shortly. Just being curious, but what will be the "great new features" in R8? Is there anything online I didn't see yet? Is the preview at EUC'2001 going to be put up afterwards? Impatient in Bavaria, CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From mvelev@REDACTED Fri Aug 24 10:09:08 2001 From: mvelev@REDACTED (Miroslav Velev) Date: Fri, 24 Aug 2001 04:09:08 -0400 Subject: MTV'02: Call for Papers Message-ID: <200108240809.EAA18250@sonata.ece.cmu.edu> Microprocessor Test and Verification (MTV'02) January 21-22, 2002, Austin, Texas, USA: http://ece.tamu.edu/MTV/ Deadline for submission of abstracts: October 26, 2001 P.S. Note the special topic on optimizing SAT procedures for application to testing and formal verification. From tobbe@REDACTED Fri Aug 24 13:19:57 2001 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: 24 Aug 2001 13:19:57 +0200 Subject: erlang,mnesia and Windows Message-ID: Hi, I'm trying to get Mnesia going under Windows. >From a cygwin rxvt/tcsh I get the following: ------------- > erl -mnesia dir d:/cygwin/home/tobbe/tmp Eshell V5.0.2 (abort with ^G) 1> init:get_arguments(). [{root,["D:\\ERL50~1.2"]}, {progname,["erl"]}, {mnesia,["dir","d:/cygwin/home/tobbe/tmp"]}, {home,["C:\\WINDOWS"]}] 2> application:start(mnesia). =ERROR REPORT==== 24-Aug-2001::11:25:02 === application_controller: syntax error before: '/': d:/cygwin/home/tobbe/tmp {error,{bad_environment_value,"d:/cygwin/home/tobbe/tmp"}} --------------- But ls/0 works fine (tmp is empty): --------------- 3> ls("d:/cygwin/home/tobbe/tmp"). ok --------------- And here is another example: ------------------ 4> file:open("/cygwin/home/tobbe/tmp/heja",[write]). {ok,<0.47.0>} 5> > ls tmp heja > erl -mnesia dir /cygwin/home/tobbe/tmp Eshell V5.0.2 (abort with ^G) 1> application:start(mnesia). {error,{bad_environment_value,"/cygwin/home/tobbe/tmp"}} =ERROR REPORT==== 24-Aug-2001::11:58:53 === application_controller: syntax error before: '/': /cygwin/home/tobbe/tmp -------------------- Ideas anyone ? Cheers /Tobbe From Jens.Peder.Terjesen@REDACTED Fri Aug 24 16:10:13 2001 From: Jens.Peder.Terjesen@REDACTED (Jens Peder Terjesen (ETO)) Date: Fri, 24 Aug 2001 16:10:13 +0200 Subject: erlang,mnesia and Windows Message-ID: Hi. Could it be that you should use \ (backslash) instead of / (slash) as directory delimiter? Jens -----Original Message----- From: Torbjorn Tornkvist [mailto:tobbe@REDACTED] Sent: 24. august 2001 13:20 To: erlang-questions@REDACTED Subject: erlang,mnesia and Windows Hi, I'm trying to get Mnesia going under Windows. >From a cygwin rxvt/tcsh I get the following: ------------- > erl -mnesia dir d:/cygwin/home/tobbe/tmp Eshell V5.0.2 (abort with ^G) 1> init:get_arguments(). [{root,["D:\\ERL50~1.2"]}, {progname,["erl"]}, {mnesia,["dir","d:/cygwin/home/tobbe/tmp"]}, {home,["C:\\WINDOWS"]}] 2> application:start(mnesia). =ERROR REPORT==== 24-Aug-2001::11:25:02 === application_controller: syntax error before: '/': d:/cygwin/home/tobbe/tmp {error,{bad_environment_value,"d:/cygwin/home/tobbe/tmp"}} --------------- But ls/0 works fine (tmp is empty): --------------- 3> ls("d:/cygwin/home/tobbe/tmp"). ok --------------- And here is another example: ------------------ 4> file:open("/cygwin/home/tobbe/tmp/heja",[write]). {ok,<0.47.0>} 5> > ls tmp heja > erl -mnesia dir /cygwin/home/tobbe/tmp Eshell V5.0.2 (abort with ^G) 1> application:start(mnesia). {error,{bad_environment_value,"/cygwin/home/tobbe/tmp"}} =ERROR REPORT==== 24-Aug-2001::11:58:53 === application_controller: syntax error before: '/': /cygwin/home/tobbe/tmp -------------------- Ideas anyone ? Cheers /Tobbe From francesco@REDACTED Sat Aug 25 10:33:42 2001 From: francesco@REDACTED (Francesco Cesarini) Date: Sat, 25 Aug 2001 09:33:42 +0100 Subject: OTP R5B & OTP R7B References: <3B83AC9C.791CF833@eei.ericsson.se> Message-ID: <3B8762E6.A14558F5@erlang-consulting.com> You can use erlang:info(version). Francesco -- http://www.erlang-consulting.com Mark Corkery wrote: > Hi, > > I've got two remote systems, one based on R5B and another based on R7B. > I want to tell which is which from a central R6B machine. How can I do > this (taking into account the fact that the R5B machine code cannot be > updated). > > /Mark > > P.S. is there a better way than erl -version??? -------------- next part -------------- A non-text attachment was scrubbed... Name: francesco.vcf Type: text/x-vcard Size: 352 bytes Desc: Card for Francesco Cesarini URL: From salcaraz@REDACTED Sat Aug 25 17:31:10 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Sat, 25 Aug 2001 17:31:10 +0200 (CEST) Subject: Background mode In-Reply-To: <200108240809.EAA18250@sonata.ece.cmu.edu> Message-ID: Hello friends: I have a small problem: 1. Is it possible to launch Erlang shell, load a module and execute a function, from Linux shell. 2. Is it possible to launch Erlang shell in Background mode from Linux shell? Thank you in advance __________________________________________________________________________ Salvador Alcaraz Carrasco http://www.umh.es Division de Ingenieria Telematica http://obelix.umh.es Dpto. Fisica y Arquitectura de Computadores salcaraz@REDACTED Universidad Miguel Hernandez salcaraz@REDACTED Avda. del ferrocarril, s/n Telf. +34 96 665 8495 Elche, Alicante (Spain) __________________________________________________________________________ From complog@REDACTED Mon Aug 27 17:55:12 2001 From: complog@REDACTED (Logic Programming Rsrch Association) Date: Mon, 27 Aug 2001 09:55:12 -0600 Subject: CFP: CICLOPS'01 Message-ID: <200108271555.f7RFtCl31573@pippo.cs.nmsu.edu> ======================================================================== LAST CALL FOR PAPERS ======================================================================== We apologize for multiple copies of this mail / posting ======================================================================== Post-Conference Workshop CICLOPS 2001 Colloquium on Implementation of Constraint and LOgic Programming Systems held in conjunction with the International Conference on Logic Programming and International Conference on Principles and Practice of Constraint Programming Paphos, Cyprus December 1, 2001 ======================================================================== see also: http://www.cs.nmsu.edu/~complog/conferences/ciclops01 ======================================================================== This workshop is a continuation of the series of workshops on Implementations of Logic Programming Systems, previously held with considerable success in Budapest (1993), Santa Margherita (1994) and Ithaca (1994), as well as the Compulog Net workshops on Parallelism and Implementation Technologies held in Madrid (1993-4), Utrecht (1995), Bonn (1996), Port Jefferson (1997), Manchester (1998), Las Cruces (1999), and London (2000). This year, the event will join forces with TRICS (Techniques for Implementing Constraint Programming Systems), previously held in Singapore (2000), thus providing coverage to implementation technology for both Logic and Constraint Programming. The last years have seen continuous progress in the computing technology available both for the academic and commercial computing environments. Examples include improved processor performance, increased memory capacity and bandwidth, faster networking technology, and Operating System support for cluster computing. Combined with recent advances in compilation technologies, these improvements are causing high-level languages to be regarded as good candidates for programming complex, real world applications. Logic Programming and Constraint Programming, in particular, seem to offer one of the best alternatives, as they couple a very high level of abstraction and a declarative nature with an extreme flexibility in the design of its execution model. The main intent of this workshop is to bring together, in an informal and friendly setting, key researchers on implementation technologies for logic and constraint-based languages and systems, in order to promote a much needed exchange of ideas and feedback on recent developments. The workshop is focused on design and implementation of logic and constraint programming systems whether sequential, parallel, or concurrent. Preference will be given to the analysis and description of implemented systems (or systems currently under implementation) and their associated techniques, problems found in their development or design, and steps taken towards the solution of these problems. Suggested topics of interest include, but are not limited to: - standard and non-standard implementation schemes e.g. modification of WAM, translation to C, native-code generation etc. - optimizing compilers and static analysis - parallelism and concurrency - techniques for the implementation of different extensions of logic and constraint programming, e.g., multi-paradigm languages and systems, non-monotonic reasoning systems, inductive logic programming - benchmarking and performance evaluation - Software design aspects of LP/CP systems: components, patterns, etc. - memory management and garbage collection - programming environments - tools for internet applications - experiences from using systems in real-life applications Contributions: -------------- Authors are invited to submit papers written in English and not exceeding 12 pages (10pts Font, letter-size paper, 1 inch margin). To speed up the process of refereeing, authors are requested to submit their paper in Postscript or PDF form by electronic mail to the workshop coordinator (e-mail address below). Conventional paper copies may be sent to the contact address below only if access to electronic media is not available. Submissions should contain full return mail and email address (if applicable), and FAX number (if applicable) of the contact author. Prospective authors are kindly requested to first send an indication of interest together with a paper title to the organizers. Deadline for submissions is September 5, 2001. Authors submitting by electronic mail will receive an acknowledgement (also by electronic mail) within 2-3 days. Accepted papers: ---------------- Submitted papers will be reviewed by at least two referees. Authors will be notified of the acceptance of their papers by September 23, 2001. To be included in the workshop proceedings (to be distributed to the workshop participants), revised versions of the accepted papers must be sent no later than October 5, 2001. Electronic versions of the accepted papers will be also made available through the workshop's homepage. Workshop Chairs: ---------------- I. Dutra (Federal University of Rio de Janeiro, Brazil) M. Henz (National University of Singapore, Singapore) Program committee: ------------------ M. Carro (Politechnic Univ. of Madrid, Spain) M. Carlsson (SICS, Sweden) B. Demoen (K.U. Leuven, Belgium) G. Gupta (Univ. of Texas at Dallas, USA) F. Laburthe (Bouygues E-lab, France) I. Niemela (Helsinki University of Technology, Finland) E. Pontelli (New Mexico State University, USA) V. Santos Costa (Federal University of Rio de Janeiro, Brazil) C. Schulte (Universitat des Saarlandes, Germany) F. Silva (Univ. of Porto, Portugal) Important dates: ---------------- Indication of interest: as soon as possible Submission of papers: September 5, 2001 Notification of authors: September 23, 2001 Final version sent by: October 5, 2001 ICLP'01 Conference: Nov. 26 - Dec. 1, 2001 Workshop: December 1, 2001 Contact address for Workshop Coordinator: ----------------------------------------- Enrico Pontelli Dept. Computer Science New Mexico State University Box 30001/CS, Las Cruces, NM 88003 Phone: +1 (505) 646-6239 FAX: +1 (505) 646-1002 email: epontell@REDACTED Workshop Web Site: ------------------ http://www.cs.nmsu.edu/~complog/conferences/ciclops01 ======================================================================== From nico.weling@REDACTED Tue Aug 28 14:01:31 2001 From: nico.weling@REDACTED (Nico Weling) Date: Tue, 28 Aug 2001 14:01:31 +0200 Subject: Simple question Message-ID: <3B8B881B.574FCF6A@eed.ericsson.se> Hi Erlang freaks, I need OR within an case clause. Something like: case Name of peter OR klaus OR carsten -> io:format("Is a man~n",[]); anna OR birgit OR petra -> io:format("Is a woman~n", []); Other -> io:format("Is a Zombie~n", []) end. Is this possible, and if, how is the syntax. Thanx a lot, Nico. From richardc@REDACTED Tue Aug 28 14:18:29 2001 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 28 Aug 2001 14:18:29 +0200 (MET DST) Subject: Simple question In-Reply-To: <3B8B881B.574FCF6A@eed.ericsson.se> Message-ID: On Tue, 28 Aug 2001, Nico Weling wrote: > Hi Erlang freaks, Hi! > I need OR within an case clause. ... > Is this possible, and if, how is the syntax. Try this: case Name of X when X == peter; X == klaus; X == carsten -> io:format("Is a man~n",[]); X when X == anna; X == birgit; X == petra -> io:format("Is a woman~n", []); _ -> io:format("Is a Zombie~n", []) end. In other words, in a guard, you can have a ';'-separated sequence of alternative conditions (a disjunction), where each condition is a ','-separated sequence of boolean tests (a conjunction). (You could also use 'if' instead of 'case' for the above.) /Richard Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ From Ingela.Anderton@REDACTED Tue Aug 28 14:31:03 2001 From: Ingela.Anderton@REDACTED (UAB/L/K Ingela Anderton konsult OTP) Date: Tue, 28 Aug 2001 14:31:03 +0200 (MEST) Subject: Simple question References: <3B8B881B.574FCF6A@eed.ericsson.se> Message-ID: <200108281231.OAA01932@luthien.du.uab.ericsson.se> If you want to read about this in the documentation look under Erlang Extensions Since 4.4 (I know it is not self-evident that there is the place to look ;-)). Richard Carlsson wrote: > > On Tue, 28 Aug 2001, Nico Weling wrote: > > > Hi Erlang freaks, > > Hi! > > > I need OR within an case clause. ... > > Is this possible, and if, how is the syntax. > > Try this: > > case Name of > X when X == peter; X == klaus; X == carsten -> > io:format("Is a man~n",[]); > X when X == anna; X == birgit; X == petra -> > io:format("Is a woman~n", []); > _ -> > io:format("Is a Zombie~n", []) > end. > > In other words, in a guard, you can have a ';'-separated sequence of > alternative conditions (a disjunction), where each condition is a > ','-separated sequence of boolean tests (a conjunction). > > (You could also use 'if' instead of 'case' for the above.) > > /Richard > > > Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) > E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ -- /m.v.h Ingela //The highway of life is always under construction. // |\ _,,,--,,_ ,) /,`.-'`' -, ;-;;' |,4- ) )-,_ ) /\ '---''(_/--' (_/-' Ericsson Utvecklings AB Cellular/Mobile: +46 70 636 78 68 From snickl@REDACTED Tue Aug 28 14:39:18 2001 From: snickl@REDACTED (snickl@REDACTED) Date: Tue, 28 Aug 2001 14:39:18 +0200 (CEST) Subject: Simple question In-Reply-To: <3B8B881B.574FCF6A@eed.ericsson.se> Message-ID: On Tue, 28 Aug 2001, Nico Weling wrote: > Hi Erlang freaks, > > I need OR within an case clause. Something like: In function guards this is done with the semicolon (;) instead of ",", but im not sure about the other places. CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From nico.weling@REDACTED Tue Aug 28 15:23:50 2001 From: nico.weling@REDACTED (Nico Weling) Date: Tue, 28 Aug 2001 15:23:50 +0200 Subject: Simple question References: Message-ID: <3B8B9B66.F926A7E9@eed.ericsson.se> Thank you it's working! Regards, Nico. Richard Carlsson wrote: > > On Tue, 28 Aug 2001, Nico Weling wrote: > > > Hi Erlang freaks, > > Hi! > > > I need OR within an case clause. ... > > Is this possible, and if, how is the syntax. > > Try this: > > case Name of > X when X == peter; X == klaus; X == carsten -> > io:format("Is a man~n",[]); > X when X == anna; X == birgit; X == petra -> > io:format("Is a woman~n", []); > _ -> > io:format("Is a Zombie~n", []) > end. > > In other words, in a guard, you can have a ';'-separated sequence of > alternative conditions (a disjunction), where each condition is a > ','-separated sequence of boolean tests (a conjunction). > > (You could also use 'if' instead of 'case' for the above.) > > /Richard > > Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) > E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ -- Nico Weling Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 5217 Fax: +49 2407 575 651 Dect:+49 2407 575 89339 mailto:Nico.Weling@REDACTED From Sean.Hinde@REDACTED Tue Aug 28 20:41:11 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 28 Aug 2001 19:41:11 +0100 Subject: Driver question Message-ID: <402DD461F109D411977E0008C791C312039F632A@imp02mbx.one2one.co.uk> Hi, A further question about the suggestion below: > Yes they do. They might be exactly what you need. The driver binaries > are reference counted, and when you call driver_allocate_binary(), > refcnt is set to 1 (only the driver is holding the binary). > > When you later call driver_output_binary(), refcnt is > incremented to 2, > and note that the driver must not change the contents from > now on, since > erlang processes now can see the data and depend on this. The driver > migth as well call driver_free_binary(), which just decrements refcnt. > Only when refcnt decrements to 0, the binary is actually freed. > > Every erlang process that now receives the binary will > increment refcnt, > and when the binary is garbage collected and found to be unused refcnt > is decremented and finaly freed by the last erlang processe > that garbage > collects it. I have played with this somewhat.. I allocate the binary in the driver and send the result to erlang. The refc is now 2 (although it sometime goes to 3 for a short time?). I do not free it at this time as I want to read the refc in a future call to my driver and then if it is back to 1 I can free up a whole load of other stuff as well as the binary. I have a fixed size array of handles so it is possible for them all to be used up in which case I return "congestion". The behaviour I can't quite figure out though is that of erlang:garbage_collect(). If I call this, the binaries are not immediately reduced to refc = 1. It takes something like 10 seconds before any of them are freed and then some appear to never be freed. My binaries are 2 octets long. Any thoughts on the behaviour of the garbage collector in this situation? Thanks, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From Sean.Hinde@REDACTED Tue Aug 28 21:05:38 2001 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 28 Aug 2001 20:05:38 +0100 Subject: Driver question Message-ID: <402DD461F109D411977E0008C791C312039F632B@imp02mbx.one2one.co.uk> I just found that it apears to be related to the fact that I was calling the routine from the shell. I guess the shell was holding onto results of old function calls or some such thing. If I call this in another process it works beautifully - even in a tight loop the binaries are cleared to refc 1 after 4 or 5 more calls. Cheers, Sean > > Hi, > > A further question about the suggestion below: > > > Yes they do. They might be exactly what you need. The > driver binaries > > are reference counted, and when you call driver_allocate_binary(), > > refcnt is set to 1 (only the driver is holding the binary). > > > > When you later call driver_output_binary(), refcnt is > > incremented to 2, > > and note that the driver must not change the contents from > > now on, since > > erlang processes now can see the data and depend on this. The driver > > migth as well call driver_free_binary(), which just > decrements refcnt. > > Only when refcnt decrements to 0, the binary is actually freed. > > > > Every erlang process that now receives the binary will > > increment refcnt, > > and when the binary is garbage collected and found to be > unused refcnt > > is decremented and finaly freed by the last erlang processe > > that garbage > > collects it. > > I have played with this somewhat.. I allocate the binary in > the driver and send the result to erlang. The refc is now 2 > (although it sometime goes to 3 for a short time?). I do not > free it at this time as I want to read the refc in a future > call to my driver and then if it is back to 1 I can free up a > whole load of other stuff as well as the binary. > > I have a fixed size array of handles so it is possible for > them all to be used up in which case I return "congestion". > > The behaviour I can't quite figure out though is that of > erlang:garbage_collect(). If I call this, the binaries are > not immediately reduced to refc = 1. It takes something like > 10 seconds before any of them are freed and then some appear > to never be freed. > > My binaries are 2 octets long. > > Any thoughts on the behaviour of the garbage collector in > this situation? > > Thanks, > Sean > NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From salcaraz@REDACTED Wed Aug 29 01:38:43 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Wed, 29 Aug 2001 01:38:43 +0200 (CEST) Subject: Background mode In-Reply-To: Message-ID: Thank you very much, Tobbe. It's working. __________________________________________________________________________ Salvador Alcaraz Carrasco http://www.umh.es Division de Ingenieria Telematica http://obelix.umh.es Dpto. Fisica y Arquitectura de Computadores salcaraz@REDACTED Universidad Miguel Hernandez salcaraz@REDACTED Avda. del ferrocarril, s/n Telf. +34 96 665 8495 Elche, Alicante (Spain) __________________________________________________________________________ On 27 Aug 2001, Torbjorn Tornkvist wrote: > > > 1. Is it possible to launch Erlang shell, load a module and execute a > > function, from Linux shell. > > erl [-pa ] -s > > > 2. Is it possible to launch Erlang shell in Background mode from Linux > > shell? > > Add '-detached' to the above. > > Cheers /Tobbe > > From rv@REDACTED Wed Aug 29 11:24:37 2001 From: rv@REDACTED (Robert Virding) Date: Wed, 29 Aug 2001 11:24:37 +0200 Subject: Three IO library related problems In-Reply-To: Your message of "Thu, 02 Aug 2001 22:40:52 +0200." <15209.47828.851685.843103@antilipe.corelatus.se> Message-ID: <200108290924.f7T9Obl26686@duva.bluetail.com> Sorry for not replying a little earlier. matthias@REDACTED writes: >#1 > >In R7B-3: > > 18> io_lib:fread("~d.~d", "22"). > > =ERROR REPORT==== 2-Aug-2001::21:37:53 === > ERROR: "Error in process <0.54.0> with exit value: > {function_clause,[{io_lib_fread,fread,[\".~d\",[],2,[22]]}, > {erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]}\n" > ** exited: {function_clause,[{io_lib_fread,fread,[".~d",[],2,[22]]}, > {erl_eval,expr,3}, > {erl_eval,exprs,4}, > {shell,eval_loop,2}]} ** > >I think it should return {more, ....}. The thought of patching >io_lib_fread.erl without a test suite makes me feel weak. 'catch' >is a halfway useful workaround. No, this is perfectly correct. io_lib:fread/2 takes a format string and an input string and tries to extract ALL the specified fields. It is not re-entrant! The function io_lib:fread/3 is the re-entrant call where the first argument is the continuation. The initial continuation must be []. It will return {more,Cont} as you wished. >#2 > >On a related note, it'd be nice if the man page/web page for io_lib >said that the {more, ....} tuple returned from fread/2 can be used as >a continuation for fread/3. If the manual implies that io_lib:fread/2 is the initial re-entrant call then it is wrong. >#3 > >Back in November there was a discussion about operations with binaries >and io sometimes guzzling memory. Just writing > > 3> {bla, Bin}. > >on the shell prompt for a modest-sized binary would consume huge >amounts of RAM. This was traced to a bug in io_lib_pretty and >Robert Virding posted a fix to the mailing list. The fix isn't in >R7B-3. Has this slipped between the cracks, or is it waiting for >a volunteer to submit a proper diff? This fix has been implemented in the new R8 which is coming sometime during the autumn. Robert From salcaraz@REDACTED Wed Aug 29 23:23:50 2001 From: salcaraz@REDACTED (Salvador Alcaraz) Date: Wed, 29 Aug 2001 23:23:50 +0200 (CEST) Subject: "Concurrent Programming in Erlang" Message-ID: Hello, friends: ?Anybody know anything about the book "Concurrent Programming in Erlang? Is it sold out? Is it possible buy it in a library? In Spain, I have about 6 mounths trying to buy this book?. Thank you in advance. __________________________________________________________________________ Salvador Alcaraz Carrasco http://www.umh.es Division de Ingenieria Telematica http://obelix.umh.es Dpto. Fisica y Arquitectura de Computadores salcaraz@REDACTED Universidad Miguel Hernandez salcaraz@REDACTED Avda. del ferrocarril, s/n Telf. +34 96 665 8495 Elche, Alicante (Spain) __________________________________________________________________________ From matthias@REDACTED Thu Aug 30 00:41:14 2001 From: matthias@REDACTED (matthias@REDACTED) Date: Thu, 30 Aug 2001 00:41:14 +0200 Subject: Three IO library related problems In-Reply-To: <200108290924.f7T9Obl26686@duva.bluetail.com> References: <15209.47828.851685.843103@antilipe.corelatus.se> <200108290924.f7T9Obl26686@duva.bluetail.com> Message-ID: <15245.28554.347168.155456@antilipe.corelatus.se> Matthias wrote > >In R7B-3: > > > > 18> io_lib:fread("~d.~d", "22"). > > > > =ERROR REPORT==== 2-Aug-2001::21:37:53 === > > ERROR: "Error in process <0.54.0> with exit value: > > {function_clause,[{io_lib_fread,fread,[\".~d\",[],2,[22]]}, > > {erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]}\n" > > ** exited: {function_clause,[{io_lib_fread,fread,[".~d",[],2,[22]]}, > > {erl_eval,expr,3}, > > {erl_eval,exprs,4}, > > {shell,eval_loop,2}]} ** > > > >I think it should return {more, ....}. Robert wrote > No, this is perfectly correct. io_lib:fread/2 takes a format string > and an input string and tries to extract ALL the specified fields. It > is not re-entrant! If it's not intended to be re-entrant, why does fread/2 return {more, ...} in some cases? Consider these two cases: io_lib:fread("~d.~d", "22") crashes the process (function_clause) io_lib:fread("~d~d", "22") returns {more,"~d",2,[22]} If this is perfectly correct, then (a) how can I guess whether the fread/2 is going to crash or return {more, ...} for a particular input which only satisfies part of the format string and (b) why is it crashing with function_clause as a reason instead of badarg? > >On a related note, it'd be nice if the man page/web page for io_lib > >said that the {more, ....} tuple returned from fread/2 can be used as > >a continuation for fread/3. > If the manual implies that io_lib:fread/2 is the initial re-entrant > call then it is wrong. When io_lib:fread/2 returns {more, ...}, it's returning something which looks like a continuation for io_lib:fread/3, but isn't. With some re-shuffling and wrapping it can be (ab)used as a "clayton's continuation" for fread/2. My mistaken inference. Matthias From kent@REDACTED Thu Aug 30 00:49:49 2001 From: kent@REDACTED (Kent Boortz) Date: 30 Aug 2001 00:49:49 +0200 Subject: "Concurrent Programming in Erlang" In-Reply-To: Salvador Alcaraz's message of "Wed, 29 Aug 2001 23:23:50 +0200 (CEST)" References: Message-ID: > ?Anybody know anything about the book "Concurrent Programming in Erlang? > > Is it sold out? > > Is it possible buy it in a library? > > In Spain, I have about 6 mounths trying to buy this book?. You know the first part of the book can be found on-line in PDF format at www.erlang.org? http://www.erlang.org/download/erlang-book-part1.pdf kent From hal@REDACTED Thu Aug 30 00:51:21 2001 From: hal@REDACTED (Hal Snyder) Date: 29 Aug 2001 17:51:21 -0500 Subject: "Concurrent Programming in Erlang" In-Reply-To: References: Message-ID: <87ofoyqy3a.fsf@ghidra.vail> Salvador Alcaraz writes: > ?Anybody know anything about the book "Concurrent Programming in Erlang? > > Is it sold out? > > Is it possible buy it in a library? > > In Spain, I have about 6 mounths trying to buy this book?. That is about how long it took to get my copy in Illinois. :-( Depends whether you can find a store with the book in stock. AFAIK it's still in print. Amazon quotes 2-3 days. No doubt you know that the first half of the red book is on line at the Erlang.org website http://www.erlang.org/download/erlang-book-part1.pdf as well as Maurice Castro's exellent tutorial http://www.serc.rmit.edu.au/~maurice/erlbk/ So... Who will write the second edition? The old red book doesn't do justice to Erlang. Want help? From enano@REDACTED Thu Aug 30 01:25:22 2001 From: enano@REDACTED (Miguel Barreiro Paz) Date: Thu, 30 Aug 2001 01:25:22 +0200 (CEST) Subject: "Concurrent Programming in Erlang" In-Reply-To: Message-ID: Hi, > ?Anybody know anything about the book "Concurrent Programming in Erlang? The authors are on this list, so someone presumably does :) > Is it sold out? > Is it possible buy it in a library? > In Spain, I have about 6 mounths trying to buy this book?. I'm not sure if it's sold out, but Amazon sure lists it as available: http://www.amazon.com/exec/obidos/ASIN/013508301X/qid=999126661/sr=1-1/ref=sc_b_1/002-7830775-7202424 The library at our faculty has a couple of them bought maybe two or three years ago, so getting them in Spain should be no problem. I can try to find out the reseller if you want. Note that the first part of the book is available as PDF on the web, http://www.es.erlang.org/download/erlang-book-part1.pdf (from the spanish mirror, or s/\.es\.// for the main site :) ). By the way, is anyone among the Erlang fathers or maybe at CSLab working on an updated book? Regards, Miguel From vances@REDACTED Thu Aug 30 01:38:18 2001 From: vances@REDACTED (Vance Shipley) Date: Wed, 29 Aug 2001 19:38:18 -0400 Subject: "Concurrent Programming in Erlang" In-Reply-To: <87ofoyqy3a.fsf@ghidra.vail> Message-ID: Does this book not come with the Erlang documentation set available from Ericsson Utvecklings AB (http://www.erlang.se/doc/index.shtml) any longer? That's where I got all three copies of mine. -Vance From vances@REDACTED Thu Aug 30 01:39:05 2001 From: vances@REDACTED (Vance Shipley) Date: Wed, 29 Aug 2001 19:39:05 -0400 Subject: "Concurrent Programming in Erlang" In-Reply-To: <87ofoyqy3a.fsf@ghidra.vail> Message-ID: > Who will write the second edition? I have the second edition. It's just a couple pages longer than the first. :) -Vance From Bruce@REDACTED Thu Aug 30 11:29:09 2001 From: Bruce@REDACTED (Bruce Fitzsimons) Date: Thu, 30 Aug 2001 21:29:09 +1200 Subject: More Driver Questions :-) Message-ID: <053501c13136$395d37d0$4021970a@neolineas.com> Peoples, Firstly thanks to Ulf and Raimo for their response to my process limits questions, your responses were really useful - I just need to find some time to implement it now... My next question is about linked-in drivers. Sean, Vance and Raimo have had lots of interesting discussions that I have been following with interest as I have my own pet driver for connecting Erlang to Dialogic telephony boards (analog pots api) under Linux. Its actually nearing a stage where I can post it on sourceforge and people can comment on my crap code and design :-) Anyway I have an important question about scope and visibility of the buffer passed to driver_output. In my case I have a signal handler in my driver that is invoked on Dialogic events (onhook/offhook/answer etc). It suspends the signal on entry and releases on exit inside the handler to avoid re-entrancy problems. However my driver is consistently but randomly crashing Erlang with segfault. From one core dump it appeared to be inside real erlang doing memcpy's with insanely large lengths (Eg corrupt memory) and sometimes I get corrupted data posted to the erlang half of the driver (even once I got a complete debug statement instead of the data). I get about 50-200 calls (on an 8 port system) before crashing. Changing the buffer inside the signal handler to be static improved the runtime but did not eliminate the problem. My signal handler uses a local heap buffer of 1024 bytes which is sprintf's into and then uses driver_output to sent it to erlang (length = strlen(buffer)). eg switch(ATDX_HOOKST(dialogic_handle)) { case DX_OFFHOOK: sprintf(output_string, "%02d%02dOFFHOOK", board, channel); break; case DX_ONHOOK: sprintf(output_string, "%02d%02dONHOOK", board, channel); break; default: sprintf(output_string, "%02d%02dERROR SETHOOK", board, channel); } driver_output(erlang_port, error_string, strlen(error_string)); Is it possible that a rapid series of signals to the signal handler could corrupt the buffer that Erlang has? i.e. Does Erlang copy this buffer or use it by reference? Does it copy it immediately (before driver_output returns)? Should I be using reference-counted binaries for this (it seems a whole lot nicer)? It is of course possible that the dialogic drivers themselves are doing something bad, they are not known for perfect reliability, but my own driver code does no dynamic memory allocation at all (I wanted to avoid this problem completely). These drivers will be EPL'd and up on sourceforge under the name erlogic eventually...they're pretty hacky at the moment though Cheers, Bruce From raimo@REDACTED Thu Aug 30 12:17:41 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Thu, 30 Aug 2001 12:17:41 +0200 Subject: More Driver Questions :-) References: <053501c13136$395d37d0$4021970a@neolineas.com> Message-ID: <3B8E12C5.B65BE932@erix.ericsson.se> Signal handling in unix is not my bag though, but I can tell you this: The function driver_output() copies the passed buffer into a list or a fresh binary depending on if the port is in binary mode or not, before it returns to the driver. Doing this from a signal handler sounds dangerous. You should try to make the call to driver_output() from e.g the timeout callback, i.e polling the buffer or some other status variable. I do not know what the properties of a signal handler with respect to data shared with non-signal-handling code is, if semaphores are necessary nor allowed. Reference counted binaries will gain some performance because you get rid of one memcpy(), but you will have to allocate the binaries from non-signal-handling code, and the same with driver_output_binary(). Perhaps pre-allocate the binaries, put them in a linked list, let the signal handler fill in the binary and move it to another list (consistency problem!), let the polling timout callback call driver_output_binary(). / Raimo Niskanen, Erlang/OTP, Ericsson UAB. Bruce Fitzsimons wrote: > > Peoples, > > Firstly thanks to Ulf and Raimo for their response to my process limits > questions, your responses were really useful - I just need to find some time > to implement it now... > > My next question is about linked-in drivers. Sean, Vance and Raimo have had > lots of interesting discussions that I have been following with interest as > I have my own pet driver for connecting Erlang to Dialogic telephony boards > (analog pots api) under Linux. > > Its actually nearing a stage where I can post it on sourceforge and people > can comment on my crap code and design :-) > > Anyway I have an important question about scope and visibility of the buffer > passed to driver_output. > > In my case I have a signal handler in my driver that is invoked on Dialogic > events (onhook/offhook/answer etc). It suspends the signal on entry and > releases on exit inside the handler to avoid re-entrancy problems. > > However my driver is consistently but randomly crashing Erlang with > segfault. From one core dump it appeared to be inside real erlang doing > memcpy's with insanely large lengths (Eg corrupt memory) and sometimes I get > corrupted data posted to the erlang half of the driver (even once I got a > complete debug statement instead of the data). > > I get about 50-200 calls (on an 8 port system) before crashing. Changing the > buffer inside the signal handler to be static improved the runtime but did > not eliminate the problem. > > My signal handler uses a local heap buffer of 1024 bytes which is sprintf's > into and then uses driver_output to sent it to erlang (length = > strlen(buffer)). > > eg > > switch(ATDX_HOOKST(dialogic_handle)) > { > case DX_OFFHOOK: > sprintf(output_string, "%02d%02dOFFHOOK", board, channel); > break; > case DX_ONHOOK: > sprintf(output_string, "%02d%02dONHOOK", board, channel); > break; > default: > sprintf(output_string, "%02d%02dERROR SETHOOK", board, channel); > } > driver_output(erlang_port, error_string, strlen(error_string)); > > Is it possible that a rapid series of signals to the signal handler could > corrupt the buffer that Erlang has? i.e. Does Erlang copy this buffer or use > it by reference? Does it copy it immediately (before driver_output returns)? > > Should I be using reference-counted binaries for this (it seems a whole lot > nicer)? > > It is of course possible that the dialogic drivers themselves are doing > something bad, they are not known for perfect reliability, but my own driver > code does no dynamic memory allocation at all (I wanted to avoid this > problem completely). > > These drivers will be EPL'd and up on sourceforge under the name erlogic > eventually...they're pretty hacky at the moment though > > Cheers, > Bruce From raimo@REDACTED Thu Aug 30 13:43:04 2001 From: raimo@REDACTED (Raimo Niskanen) Date: Thu, 30 Aug 2001 13:43:04 +0200 Subject: More Driver Questions :-) References: <053501c13136$395d37d0$4021970a@neolineas.com>, <3B8E12C5.B65BE932@erix.ericsson.se> Message-ID: <3B8E26C8.5DD601E0@erix.ericsson.se> I hereby forward some comments from a signal handling guru. / Raimo Niskanen, Erlang/OTP, Ericsson UAB Raimo Niskanen wrote: > >Signal handling in unix is not my bag though, but I can tell you this: > >The function driver_output() copies the passed buffer into a list or a >fresh binary depending on if the port is in binary mode or not, before >it returns to the driver. Doing this from a signal handler sounds >dangerous. That's probably an understatement.:-) There are very few things that can be done safely from a signal handler in general, manipulating complex data structures that are also manipulated by other, non-signal-blocking parts of the code is definitely not one of them (malloc() and friends is obviously an example of this, and then there are of course all of the Erlang runtime system's internal structures). >You should try to make the call to driver_output() from e.g the timeout >callback, i.e polling the buffer or some other status variable. But timed polling is ugly.:-) > I do not >know what the properties of a signal handler with respect to data shared >with non-signal-handling code is, if semaphores are necessary nor >allowed. As long as you block the signal in question in the non-signal-handling code, you should be able to do pretty complex things I think (and not need semaphores). There is an example purporting to demonstrate how to do signal handling in a driver in erts/emulator/drivers/unix/sig_drv.c, looks nice and clean - unfortunately the crucial driver_interrupt() function that it uses doesn't exist:-) (and I seem to remember that its implementation wasn't all that great when it did exist). What Bruce could do however, perhaps a bit ugly but perhaps not, is to turn the "signal event" into an "I/O event": In the driver initialization, create a pipe(2) and register the read end of the pipe via driver_select(). Then in the signal handler just write(2) (stdio is not allowed I believe:-) to the write end of the pipe, perhaps just a single byte, which will cause the ready_input handler to be invoked on a "safe" level, where it can read from the pipe, do whatever else it needs to do, and call driver_output() without risk. --Per Hedeland From per@REDACTED Thu Aug 30 13:56:32 2001 From: per@REDACTED (per@REDACTED) Date: Thu, 30 Aug 2001 13:56:32 +0200 (CEST) Subject: More Driver Questions :-) In-Reply-To: <3B8E26C8.5DD601E0@erix.ericsson.se> Message-ID: <200108301156.f7UBuWB60019@tordmule.bluetail.com> Raimo Niskanen wrote: > >I hereby forward some comments from a signal handling guru. :-) Sorry, it wasn't intended to be private, I just didn't notice that you had: >Reply-To: raimo.niskanen@REDACTED - and apparently that wasn't because you wanted responses to be private either.:-) --Per From luke@REDACTED Thu Aug 30 16:41:51 2001 From: luke@REDACTED (Luke Gorrie) Date: 30 Aug 2001 16:41:51 +0200 Subject: parse transform Message-ID: Hiho, I want to write a parse transform to munge the arguments of calls to certain functions. To find all those functions, I'll need to recurse down all the expressions I find and so forth. Is the best approach to cut-and-paste all of erl_id_trans and then insert my new clause, or is there some more elegant but similarly easy way? Something nice would be what's called a "visitor" in the object oriented world: something generic that would traverse the parse tree and call my module to see what I want to do with each node. For most nodes I'd just say "keep the structure and recursively process the children", but for calls I'd do something special. Has anyone done something like that? If so, can I have a copy? :-) -Luke From richardc@REDACTED Thu Aug 30 17:06:20 2001 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 30 Aug 2001 17:06:20 +0200 (MET DST) Subject: parse transform In-Reply-To: Message-ID: On 30 Aug 2001, Luke Gorrie wrote: > I want to write a parse transform to munge the arguments of calls to > certain functions. To find all those functions, I'll need to recurse > down all the expressions I find and so forth. > > Is the best approach to cut-and-paste all of erl_id_trans and then > insert my new clause, or is there some more elegant but similarly easy > way? > > Something nice would be what's called a "visitor" in the object > oriented world: something generic that would traverse the parse tree > and call my module to see what I want to do with each node. For most > nodes I'd just say "keep the structure and recursively process the > children", but for calls I'd do something special. > > Has anyone done something like that? If so, can I have a copy? :-) If you check out the syntax_tools package at http://www.erlang.org/user.html, the module 'erl_syntax' contains functions to decompose any node in the syntax tree (subtrees/1), and reconstruct it (make_tree/2) after visiting the subnodes. Example (from the documentation in the source code): postorder(F, Tree) -> F(case subtrees(Tree) of [] -> Tree; List -> copy_attrs(Tree, make_tree(type(Tree), [[postorder(F, Subtree) || Subtree <- Group] || Group <- List])) end). maps the function `F' on `Tree' and all its subtrees, doing a post-order traversal of the syntax tree. If you want to return the resulting tree to the compiler, you also need to call revert/1 on it, since the standard library modules do not understand the extended syntax tree format created by the erl_syntax functions. (But you can feed "old-style" syntax trees directly to these functions without prior conversion.) If speed is of the absolute essence, you might want to modify erl_id_trans instead, but the syntax_tools package makes it a lot simpler to write this sort of thing: -module(my_parse_transform). -export([parse_transform/2]). parse_transform(Forms, Options) -> Tree = do_stuff(Forms, Options), erl_syntax:revert_forms(Tree). ...etc. /Richard Carlsson Richard Carlsson (richardc@REDACTED) (This space intentionally left blank.) E-mail: Richard.Carlsson@REDACTED WWW: http://www.csd.uu.se/~richardc/ From gupta@REDACTED Fri Aug 31 21:20:24 2001 From: gupta@REDACTED (Gopal Gupta) Date: Fri, 31 Aug 2001 14:20:24 -0500 Subject: Call for Papers: CLPSE'01 Workshop Message-ID: <200108311920.f7VJKOx26867@herbrand.utdallas.edu> CALL FOR PAPERS!! CALL FOR PAPERS!! CALL FOR PAPERS!! CLPSE'01: (Constraint) Logic Programming and Software Engineering http://www.utdallas.edu/~gupta/clpse PAPHOS, CYPRUS In Conjunction with Seventeenth International Conference on Logic Programming http://www.cs.ucy.ac.cy/~iclpcp01/ The aim of this workshop is to explore applications of logic programming and constraint programming to the process of constructing reliable software and to programming-in-the-large. Papers and experience reports describing use of LP and CP techniques to various aspects of the software engineering process are invited. The workshop will be held on Saturday, Dec 1, 2001, in conjunction with 17th International Conference on Logic Programming in Paphos, Cyprus (held Nov 26 - Dec 1) and is a continuation of the successful CLPSE'00 workshop held during CL2000 in London, England, in July 2000. (visit http://www.cs.nmsu.edu/~gupta/lpse2000) Topics of interest include (but are not limited to): o Rapid prototopying and System Modeling o Software Design Methodologies o Software Specification o Domain Specific Languages o Derivation of Efficient Implementations from Specifications o Automatic Software Generation o Testing and Debugging o Test Case Generation o Software Verification o Software Process Discovery o Software Reuse o Analysis of Software Systems/Software Process o Software Quality Assurance o Requirements Analysis o Security Issues Paper Submission deadline: Oct 15th, 2001 Notification of acceptance/rejection: Oct 25th, 2001 Submission procedure: Electronically submit a postscript, pdf, or a word file to gupta@REDACTED Papers should be a maximum of 15 pages. Proceedings will be made available during the workshop. Workshop Program Committee: Gopal Gupta, University of Texas at Dallas, USA Sam Danials, Motorola, USA Kung-Kiu Lau, University of Manchester, UK I.V. Ramakrishnan, SUNY Stony Brook, USA From rxiong@REDACTED Thu Aug 9 01:31:25 2001 From: rxiong@REDACTED (Renyi Xiong) Date: Wed, 8 Aug 2001 16:31:25 -0700 Subject: mnesia question References: Message-ID: <004201c12062$406e7870$400fa8c0@HP78819433158> Thanks guys, It's really helpful for us to understand how Mnesia works. 1.My understanding is when one node initiates a write operation it sends a message to each of the replicas at same time and doesn't care the write transaction status on other replicas. It's up to the transaction handler on each node to handle the write transaction separately. Is that right? 2.How do I know the write operation succeeds on at least on of the replicas including the one which initiates it? Thanks, Renyi. ----- Original Message ----- From: "Hakan Mattsson" To: "Ulf Wiger (AL/EAB)" Cc: "Renyi Xiong" ; ; Sent: Monday, February 13, 2006 8:54 AM Subject: RE: mnesia question On Mon, 13 Feb 2006, Ulf Wiger (AL/EAB) wrote: UW> Renyi Xiong wrote: UW> > UW> > 1. what happens if one of (not all of) the RAM replicas of UW> > Mnesia table fails when doing write operation? write fails? UW> UW> If you are using transactions, chances are good that mnesia UW> will be able to follow through after all. The transaction UW> is completed as an 'asymmetric' transaction, and the failed UW> node gets the opportunity to update itself later. Yes, the transaction is completed consistently on the surviving nodes. On the node(s) where Mnesia fails to write, Mnesia will be terminated. When Mnesia later is started on these nodes, it will pick the table contents from the surviving node(s). This fundamental behavior is the same for all types of transactions as well as for dirty writes. For transactions using 3pc, the recovery procedure is more complicated as the failing nodes may need to determine the outcome of the transaction before the transaction log can be processed. 3pc is used for transactions involving updates of the schema or asymmetrically replicated tables. UW> (Of course, assuming that the failed node is not the UW> one that initiated the transaction.) The recovery procedure is the same, even if it was the failing node that initiated the transaction. UW> If you're using dirty writes, you may end up with UW> database inconsistency. Don't use dirty writes on UW> replicated tables unless you really really know what UW> you're doing. This is a good general advice. Using dirty writes on replicated tables, is about as hazardous as using master nodes, using the max_wait_for_decision configuration parameter or to force load tables. Elaborating with these mechanisms may easily end up with an inconsistent database as they bypasses the transaction recovery procedure in Mnesia. Sometime it is necessary to use these mechanisms, but use them with care. /H?kan UW> > 2. Is Mnesia table RAM replica distributable across VPN network? UW> UW> If you can get Distributed Erlang to work, you will be able to UW> replicate mnesia tables. Without Distributed Erlang - no replication. UW> UW> UW> > 3. Is possible to add and remove RAM replica dynamically? UW> UW> Yes, using the function UW> UW> mnesia:add_table_copy(Tab, Node, Type) UW> UW> where Type == ram_copies, if it's a RAM replica you want to add. UW> UW> Removing a replica: UW> UW> mnesia:del_table_copy(Tab, Node) UW> UW> Regards, UW> Ulf W