Re: [AOLSERVER] AOLserver mailing lists have now moved to SourceForge
On Thu, Oct 27, 2011 at 01:42, Dossy Shiobara do...@panoptic.com wrote: discontinuing their LISTSERV service as of November 1st, 2011. What were the reasons cited? Just curious. FC -- The purpose of computing is insight, not numbers. Richard Hamming - http://en.wikipedia.org/wiki/Hamming_code -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLSERVER Digest - 22 Sep 2011 to 24 Sep 2011 (#2011-57)
Hi Guan, What is the value of [encoding system] on a regular page or in the context where you call ns_returnfile? "[encoding system]" returns utf-8 just before running "ns_returnfile 200 $type $file" If I set "encoding system iso8859-1" before "ns_returnfile 200 $type $file" rp_serve_concrete_file also fails. ./k On 25/09/2011 6:20, Guan Yang wrote: What is the value of [encoding system] on a regular page or in the context where you call ns_returnfile? On Sep 25, 2011, at 0:00, AOLSERVER automatic digest system lists...@listserv.aol.com wrote: tx everybody for the very useful input! Using ns_returnfp is (for several reasons) not an option for us. Recompiling tcl using --with-encoding utf-8 did not resolve the problem. This time I used AOLserver 4.5.1 / tcl8.5.10. I gave it a try since some of our users do upload files using tools such as WINSCP. Since these files would also need to be accessible through the ]project-open[ file manager, we need to come up with a slightly more complex solution to detect files with special chars. ./k On 23/09/2011 1:32, Jeff Rogers wrote: Another thing you could do is to set tcl's default encoding to utf-8, so that the filenames passed to Ns_ConnReturnFile are the same encoding as what the core tcl commands do. Set the default encoding with encoding system utf-8 in some tcl file. It's possible this could have some side effects. I'm trying to figure out what needs to be patched in the server for this to do the right thing, but encoding is a messy business. -J Jim Davidson wrote: Howdy, Looking at the code, ns_returnfile passes the filename through to the core Ns_ConnReturnFile without any of the care that core Tcl does handling filenames. You may be able to replace ns_returnfile with ns_returnfp, passing a file handle returned from Tcl's open command which should be smarter with filesystem encoding. The downside is that would bypass some of the smarts within the underlying Ns_ConnReturnFile used by ns_returnfile: It appears to set Last-Modified headers, optionally cache small files, mmap large files, etc. All this may not matter if you're doing one-shot type work, e.g., returning a custom crafted file for just one user, just once. -Jim On Sep 22, 2011, at 3:27 PM, Peter Sadlon wrote: Just a guess here, but by default, TCL is compiled with Latin-1 encoding. This causes some issues when you are trying to do certain things in utf-8, even if you set all possible TCL config variables to use the UTF-8 charset. You could attempt to recompile TCL with --with-encoding utf-8 But in the end, your final comment is correct, it is best to encode the filename, then you don't have to worry about a bunch of special cases. Date: Thu, 22 Sep 2011 22:59:02 +0200 From: klaus.hofed...@project-open.com mailto:klaus.hofed...@project-open.com Subject: [AOLSERVER] Fwd: AOLserver 4.5.0 - ns_returnfile does not find file - file name contains special chars To: AOLSERVER@LISTSERV.AOL.COM mailto:AOLSERVER@LISTSERV.AOL.COM Hi all at ]project-open[ we currently use AOLserver 4.5.0 with OpenACS 5.6.0 on CentOS release 5.3 (Final)
Re: [AOLSERVER] AOLSERVER Digest - 22 Sep 2011 to 24 Sep 2011 (#2011-57)
What is the value of [encoding system] on a regular page or in the context where you call ns_returnfile? On Sep 25, 2011, at 0:00, AOLSERVER automatic digest system lists...@listserv.aol.com wrote: tx everybody for the very useful input! Using ns_returnfp is (for several reasons) not an option for us. Recompiling tcl using --with-encoding utf-8 did not resolve the problem. This time I used AOLserver 4.5.1 / tcl8.5.10. I gave it a try since some of our users do upload files using tools such as WINSCP. Since these files would also need to be accessible through the ]project-open[ file manager, we need to come up with a slightly more complex solution to detect files with special chars. ./k On 23/09/2011 1:32, Jeff Rogers wrote: Another thing you could do is to set tcl's default encoding to utf-8, so that the filenames passed to Ns_ConnReturnFile are the same encoding as what the core tcl commands do. Set the default encoding with encoding system utf-8 in some tcl file. It's possible this could have some side effects. I'm trying to figure out what needs to be patched in the server for this to do the right thing, but encoding is a messy business. -J Jim Davidson wrote: Howdy, Looking at the code, ns_returnfile passes the filename through to the core Ns_ConnReturnFile without any of the care that core Tcl does handling filenames. You may be able to replace ns_returnfile with ns_returnfp, passing a file handle returned from Tcl's open command which should be smarter with filesystem encoding. The downside is that would bypass some of the smarts within the underlying Ns_ConnReturnFile used by ns_returnfile: It appears to set Last-Modified headers, optionally cache small files, mmap large files, etc. All this may not matter if you're doing one-shot type work, e.g., returning a custom crafted file for just one user, just once. -Jim On Sep 22, 2011, at 3:27 PM, Peter Sadlon wrote: Just a guess here, but by default, TCL is compiled with Latin-1 encoding. This causes some issues when you are trying to do certain things in utf-8, even if you set all possible TCL config variables to use the UTF-8 charset. You could attempt to recompile TCL with --with-encoding utf-8 But in the end, your final comment is correct, it is best to encode the filename, then you don't have to worry about a bunch of special cases. Date: Thu, 22 Sep 2011 22:59:02 +0200 From: klaus.hofed...@project-open.com mailto:klaus.hofed...@project-open.com Subject: [AOLSERVER] Fwd: AOLserver 4.5.0 - ns_returnfile does not find file - file name contains special chars To: AOLSERVER@LISTSERV.AOL.COM mailto:AOLSERVER@LISTSERV.AOL.COM Hi all at ]project-open[ we currently use AOLserver 4.5.0 with OpenACS 5.6.0 on CentOS release 5.3 (Final) We suddenly encountered the problem that ns_returnfile can't find a file which filname contains special chars such as 'umlaute' (ä, ö, etc.) --- convmv tells me that the file name is utf-8 encoded. --- Config.tcl has the standard settings: ns_param HackContentType1 ns_param DefaultCharset utf-8 ns_param HttpOpenCharsetutf-8 ns_param OutputCharset utf-8 ns_param URLCharset utf-8 --- Following CentOS locale: LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_ALL= --- File System is 'ext3' --- Files have been created with exec /bin/cp $filename $dest_path out of a tcl file or using 'touch/emacs' on OS level. Same results. --- We did have the problems using AOLserver 3.3 Anybody an idea what the cause might be? Probably its better to always encode file names of uploaded filesto avoid trouble when creating multi-plattform applications. Thanks for your support! Klaus -- AOLserver -http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com mailto:lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com mailto:lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF
Re: [AOLSERVER] AOLserver 4.5.1 (CVS) crashing bug on x64 with fix
Many thanks for the patch. it looks good. it applied with some minor related cleanups. -gustaf neumann On 17.08.11 19:06, Jin Choi wrote: Hello. I've tracked down and fixed a crashing bug in AOLserver on x64. I believe it is correct. AOLserver was crashing with Fatal: munmap(0x, 0) failed: Invalid argument I tracked down the only call to munmap in NsUnMap in nsd/fastpath.c. It takes the return value of NsMap and tests it against NULL. NsMap is just returning the return value from mmap(). The man page says: RETURN VALUE On success, mmap() returns a pointer to the mapped area. On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno is set appropriately. Index: nsd/fastpath.c === RCS file: /cvsroot/aolserver/aolserver/nsd/fastpath.c,v retrieving revision 1.26 diff -u -r1.26 fastpath.c --- nsd/fastpath.c 19 Apr 2006 17:48:47 - 1.26 +++ nsd/fastpath.c 16 Aug 2011 17:40:51 - @@ -521,7 +521,7 @@ } if (servPtr-fastpath.mmap) { map = NsMap(fd, 0, stPtr-st_size, 0,arg); - if (map != NULL) { + if (map != MAP_FAILED) { close(fd); fd = -1; result = Ns_ConnReturnData(conn, status, map, -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear all, i did some more digging/googling in this issue and i share the opinion that - at least for the time being - Tcl_Finalize() could be omitted on windows versions without too much harm. Some background: The Tcl manpage says: *Tcl_Finalize* is similar to*Tcl_Exit* except that it does not exit from the current process. It is useful for cleaning up when a process is finished using*Tcl* but wishes to continue executing, and when*Tcl* is used in a dynamically loaded extension that is about to be unloaded. On some systems*Tcl* is automatically notified when it is being unloaded, and it calls*Tcl_Finalize* internally; on these systems it not necessary for the caller to explicitly call*Tcl_Finalize*. However, to ensure portability, your code should always invoke*Tcl_Finalize* when *Tcl* is being unloaded, to ensure that the code will work on all plat- forms.*Tcl_Finalize* can be safely called more than once. For aolserver, it is questionable for me why we need Tcl_Finalize() (the primarily purpose for Tcl_Finalize according to its documentation is that the process wants to continue without Tcl), furthermore there seems to be some magic involved, that some systems call Tcl_Finalize() ... automatically (hinting most likely the windows situation with the assembly code). Since finalize tries to unload Tcl, there seems to be some race conditions in this area on windows, at least when there are still are multiple threads around. E.g. [1] says: Because DLL notifications are serialized, entry-point functions should not attempt to communicate with other threads or processes. Deadlocks may occur as a result. Neither aolserver 4.0.10 nor naviserver call Tcl_Finalize(), so i guess we can live with a 4.5.1+ version under windows without it. -gustaf neumann [1] http://msdn.microsoft.com/en-us/library/ms682583.aspx On 06.08.11 16:28, Maurizio Martignano wrote: It is me again... Well I noticed that the change I suggested about Tcl_Finalize did not make it into CVS HEAD. If it doesn't go there, I am afraid I will have to anyhow introduce it myself in my distribution. I need to have a working system. With that call still in, the service can't (CANNOT) be stopped gracefully. This is a matter of testing: Take the system, make it run with a real OpenACS based application (how about ]po[, or xowiki) and see how it works and see how it interacts with the system... Does it start? Does it run? Does it stop properly? For the time being in Windows 64 that function needs to be out. Thanks a lot, Maurizio Thank you, Maurizio *From:*AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] *On Behalf Of *Gustaf Neumann *Sent:* 06 August 2011 10:28 *To:* AOLSERVER@LISTSERV.AOL.COM *Subject:* Re: [AOLSERVER] Aolserver Progress - Some few examples Maurizio, Tcl_Finalize() is supposed to work, and if it does now work something is still broken in the windows version. Omitting Tcl_Finalize() is removeing the symptom, not the cause. It is not unlikely that something else will have the same problem due to this cause. When Tcl_Finalize() is not run, the registered exit handlers are not executed. How serious this is depends on the exit handlers. You are right, that the memory leak does not matter due to the shutdown. The difference is like between a graceful and an ungraceful shutdown. -gustaf On 05.08.11 16:29, Maurizio Martignano wrote: Dear Gustav, I understand your concerns about Tcl_Finalize... but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test Have Aolserver / nsd running on a big application... observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples.... All's well that ends well
Dear Gustav, Thank you. Alls well that ends well Im not sure all the changes I suggested are still in the codebase especially the ones in RED It is not up to Aolserver/nsd include system to define SOCKET as int on Windows. Thank you again, Maurizio include/ns.h 222 ß #define O_BINARY0 // Commented out by M. Martignano on the 05/08/2011 // #define SOCKET int #define INVALID_SOCKET (-1) I removed the define, in Windows (32/64) SOCKET should be defined somewhere else, and not redefined here. include/ns.h 674 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 NS_EXTERN SOCKET Ns_ConnSock(Ns_Conn *conn); Self explanatory. nsd/conn.c - 615 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 SOCKET Ns_ConnSock(Ns_Conn *conn) { Self explanatory nsd/nsd.h - 75 // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 struct pollfd { int fd; short events; short revents; }; #endif struct pollfd is already defined nsd/nsd.h - 312 // int trigger[2] changed into SOCKET trigger[2] by M. Martignano on the 05/08/2011 SOCKET trigger[2]; /* Wakeup trigger socket. */ Well, we all know about this dont we? nsd/nsmain.c 633 // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Tcl_Finalize(); #endif Semantic. Tcl_Finalize never ends on Windows so I removed it. nsd/queue.c 42 // Function added by M. Martignano on the 05/08/2011 #ifdef _WIN32 static double round(double x) { return floor(x + 0.5); } #endif Well believe it or not round does not exist. So I ehm re-implemented it based on floor. nspd/listen.c 80 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 SOCKETsock, new; Self explanatory nspd/pd.h 52 ß #include unistd.h // Conditional compilation added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Well this follows the same reasoning used for ns.h. Anyhow this is the weakest of all my changes and all the module should be carefully looked at. I am personally not using it in my Windows distributions. nsperm/nsperm.c 583 // Conditional compilation added by M. Martignano on the 05/08/2011 #ifndef _WIN32 if (inet_aton(net, ip) == 0 || inet_aton(slash+1, mask) == 0) { #else if (inet_pton(AF_INET,net, ip) == 0 || inet_pton(AF_INET,slash+1, mask) == 0) { #endif Well with Micosoft Visual C 10 inet_aton seems not to be there any longer. Luckily we can still rely on inet_pton. From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 07 August 2011 15:23 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Dear all, i did some more digging/googling in this issue and i share the opinion that - at least for the time being - Tcl_Finalize() could be omitted on windows versions without too much harm. Some background: The Tcl manpage says: Tcl_Finalize is similar to Tcl_Exit except that it does not exit from the current process. It is useful for cleaning up when a process is finished using Tcl but wishes to continue executing, and when Tcl is used in a dynamically loaded extension that is about to be unloaded. On some systems Tcl is automatically notified when it is being unloaded, and it calls Tcl_Finalize internally; on these systems it not necessary for the caller to explicitly call Tcl_Finalize. However, to ensure portability, your code should always invoke Tcl_Finalize when Tcl is being unloaded, to ensure that the code will work on all plat- forms. Tcl_Finalize can be safely called more than once. For aolserver, it is questionable for me why we need Tcl_Finalize() (the primarily purpose for Tcl_Finalize according to its documentation is that the process wants to continue without Tcl), furthermore there seems to be some magic involved, that some systems call Tcl_Finalize() ... automatically (hinting most likely the windows situation with the assembly code). Since finalize tries to unload Tcl, there seems to be some race conditions in this area on windows, at least when there are still are multiple threads around. E.g. [1] says: Because DLL notifications are serialized, entry-point functions should not attempt to communicate with other threads or processes. Deadlocks may occur as a result. Neither aolserver 4.0.10 nor naviserver call Tcl_Finalize(), so i guess we can live with a 4.5.1+ version under windows without it. -gustaf neumann [1] http://msdn.microsoft.com/en-us/library/ms682583.aspx On 06.08.11 16:28, Maurizio Martignano wrote: It is me again Well I noticed that the change I suggested about Tcl_Finalize did not make it into CVS
Re: [AOLSERVER] Aolserver Progress - Some few examples.... All's well that ends well
On 07.08.11 17:37, Maurizio Martignano wrote: Dear Gustav, Thank you. All's well that ends well... I'm not sure all the changes I suggested are still in the codebase... especially the ones in RED The reason, i have not committed theses two suggested changes to the code base is that these are incorrect and would break compilation on the non-windows platforms. Both suggested changes are in #ifdef branches for compilations without _WIN32 set (therefore irrelevant for Win32 and Win64). Please check more carefully first. -gustaf neumann It is not up to Aolserver/nsd include system to define SOCKET as int on Windows. Thank you again, Maurizio *include/ns.h -- 222 **ß*** *#define*O_BINARY0 // Commented out by M. _Martignano_ on the 05/08/2011 // #define SOCKET _int_ *#define*INVALID_SOCKET (-1) I removed the define, in Windows (32/64) SOCKET should be defined somewhere else, and not redefined here. *include/ns.h -- 674* // Type changed from _int_ to SOCKET by M. _Martignano_ on the 05/08/2011 NS_EXTERN SOCKET *Ns_ConnSock*(Ns_Conn*conn); Self explanatory. *nsd/conn.c - 615* // Type changed from _int_ to SOCKET by M. _Martignano_ on the 05/08/2011 SOCKET *Ns_ConnSock*(Ns_Conn*conn) { Self explanatory *nsd/nsd.h - 75* // Conditional compilation clause added by M. _Martignano_ on the 05/08/2011 *#ifndef*_WIN32 *struct*pollfd { *int*fd; *short*events; *short*revents; }; *#endif* struct pollfd is already defined *nsd/nsd.h - 312* // _int_ trigger[2] changed into SOCKET trigger[2] by M. _Martignano_ on the 05/08/2011 SOCKET trigger[2]; /* _Wakeup_ trigger socket. */ Well, we all know about this... don't we? *nsd/nsmain.c -- 633* // Conditional compilation clause added by M. _Martignano_ on the 05/08/2011 *#ifndef*_WIN32 Tcl_Finalize(); *#endif* Semantic. Tcl_Finalize never ends on Windows so I removed it. *nsd/queue.c -- 42* // Function added by M. _Martignano_ on the 05/08/2011 *#ifdef*_WIN32 *static**double*round(*double*x) { *return*floor(x + 0.5); } *#endif* Well believe it or not round does not exist. So I ehm re-implemented it based on floor. *nspd/listen.c -- 80 *// Type changed from _int_ to SOCKET by M. _Martignano_ on the 05/08/2011 SOCKETsock, new; Self explanatory *nspd/pd.h -- 52 **ß*** *#include*unistd.h // Conditional compilation added by M. _Martignano_ on the 05/08/2011 *#ifndef*_WIN32 Well this follows the same reasoning used for ns.h. Anyhow this is the weakest of all my changes and all the module should be carefully looked at. I am personally not using it in my Windows distributions. *nsperm/nsperm.c -- 583* // Conditional compilation added by M. _Martignano_ on the 05/08/2011 *#ifndef*_WIN32 *if*(inet_aton(net, ip) == 0 || inet_aton(slash+1, mask) == 0) { *#else* *if*(inet_pton(AF_INET,net, ip) == 0 || inet_pton(AF_INET,slash+1, mask) == 0) { *#endif* Well with Micosoft Visual C 10 inet_aton seems not to be there any longer. Luckily we can still rely on inet_pton. *From:*AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] *On Behalf Of *Gustaf Neumann *Sent:* 07 August 2011 15:23 *To:* AOLSERVER@LISTSERV.AOL.COM *Subject:* Re: [AOLSERVER] Aolserver Progress - Some few examples Dear all, i did some more digging/googling in this issue and i share the opinion that - at least for the time being - Tcl_Finalize() could be omitted on windows versions without too much harm. Some background: The Tcl manpage says: *Tcl_Finalize* is similar to*Tcl_Exit* except that it does not exit from the current process. It is useful for cleaning up when a process is finished using*Tcl* but wishes to continue executing, and when*Tcl* is used in a dynamically loaded extension that is about to be unloaded. On some systems*Tcl* is automatically notified when it is being unloaded, and it calls*Tcl_Finalize* internally; on these systems it not necessary for the caller to explicitly call*Tcl_Finalize*. However, to ensure portability, your code should always invoke*Tcl_Finalize* when *Tcl* is being unloaded, to ensure that the code will work on all plat- forms.*Tcl_Finalize* can be safely called more than once. For aolserver, it is questionable for me why we need Tcl_Finalize() (the primarily purpose for Tcl_Finalize according to its documentation is that the process wants to continue without Tcl), furthermore there seems to be some magic involved, that some systems call Tcl_Finalize() ... automatically (hinting most likely the windows situation with the assembly code). Since finalize tries to unload Tcl, there seems to be some race conditions in this area on windows, at least when there are still are multiple threads around. E.g. [1] says: Because DLL notifications are serialized, entry-point
Re: [AOLSERVER] Aolserver Progress - Some few examples.... All's well that ends well
Dear Gustav, You ARE ABSOLUTELY RIGHT! And I AM DEFINETELY A VICTIM OF ALZHEIMER. APOLOGIES Ciao, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 07 August 2011 19:02 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples All's well that ends well On 07.08.11 17:37, Maurizio Martignano wrote: Dear Gustav, Thank you. Alls well that ends well Im not sure all the changes I suggested are still in the codebase especially the ones in RED The reason, i have not committed theses two suggested changes to the code base is that these are incorrect and would break compilation on the non-windows platforms. Both suggested changes are in #ifdef branches for compilations without _WIN32 set (therefore irrelevant for Win32 and Win64). Please check more carefully first. -gustaf neumann It is not up to Aolserver/nsd include system to define SOCKET as int on Windows. Thank you again, Maurizio include/ns.h 222 ß #define O_BINARY0 // Commented out by M. Martignano on the 05/08/2011 // #define SOCKET int #define INVALID_SOCKET (-1) I removed the define, in Windows (32/64) SOCKET should be defined somewhere else, and not redefined here. include/ns.h 674 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 NS_EXTERN SOCKET Ns_ConnSock(Ns_Conn *conn); Self explanatory. nsd/conn.c - 615 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 SOCKET Ns_ConnSock(Ns_Conn *conn) { Self explanatory nsd/nsd.h - 75 // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 struct pollfd { int fd; short events; short revents; }; #endif struct pollfd is already defined nsd/nsd.h - 312 // int trigger[2] changed into SOCKET trigger[2] by M. Martignano on the 05/08/2011 SOCKET trigger[2]; /* Wakeup trigger socket. */ Well, we all know about this dont we? nsd/nsmain.c 633 // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Tcl_Finalize(); #endif Semantic. Tcl_Finalize never ends on Windows so I removed it. nsd/queue.c 42 // Function added by M. Martignano on the 05/08/2011 #ifdef _WIN32 static double round(double x) { return floor(x + 0.5); } #endif Well believe it or not round does not exist. So I ehm re-implemented it based on floor. nspd/listen.c 80 // Type changed from int to SOCKET by M. Martignano on the 05/08/2011 SOCKETsock, new; Self explanatory nspd/pd.h 52 ß #include unistd.h // Conditional compilation added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Well this follows the same reasoning used for ns.h. Anyhow this is the weakest of all my changes and all the module should be carefully looked at. I am personally not using it in my Windows distributions. nsperm/nsperm.c 583 // Conditional compilation added by M. Martignano on the 05/08/2011 #ifndef _WIN32 if (inet_aton(net, ip) == 0 || inet_aton(slash+1, mask) == 0) { #else if (inet_pton(AF_INET,net, ip) == 0 || inet_pton(AF_INET,slash+1, mask) == 0) { #endif Well with Micosoft Visual C 10 inet_aton seems not to be there any longer. Luckily we can still rely on inet_pton. From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 07 August 2011 15:23 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Dear all, i did some more digging/googling in this issue and i share the opinion that - at least for the time being - Tcl_Finalize() could be omitted on windows versions without too much harm. Some background: The Tcl manpage says: Tcl_Finalize is similar to Tcl_Exit except that it does not exit from the current process. It is useful for cleaning up when a process is finished using Tcl but wishes to continue executing, and when Tcl is used in a dynamically loaded extension that is about to be unloaded. On some systems Tcl is automatically notified when it is being unloaded, and it calls Tcl_Finalize internally; on these systems it not necessary for the caller to explicitly call Tcl_Finalize. However, to ensure portability, your code should always invoke Tcl_Finalize when Tcl is being unloaded, to ensure that the code will work on all plat- forms. Tcl_Finalize can be safely called more than once. For aolserver, it is questionable for me why we need Tcl_Finalize() (the primarily purpose for Tcl_Finalize according to its documentation is that the process wants to continue without Tcl), furthermore there seems to be some magic involved, that some systems call
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Maurizio, Tcl_Finalize() is supposed to work, and if it does now work something is still broken in the windows version. Omitting Tcl_Finalize() is removeing the symptom, not the cause. It is not unlikely that something else will have the same problem due to this cause. When Tcl_Finalize() is not run, the registered exit handlers are not executed. How serious this is depends on the exit handlers. You are right, that the memory leak does not matter due to the shutdown. The difference is like between a graceful and an ungraceful shutdown. -gustaf On 05.08.11 16:29, Maurizio Martignano wrote: Dear Gustav, I understand your concerns about Tcl_Finalize... but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test Have Aolserver / nsd running on a big application... observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Gustav, I understand perfectly than omitting the function is removing the symptom and not the cause, but process/service wise having Tcl_Finalize in that particular place (where the process/service is about to end) or not having it doesn't make any difference. The Operating System will take care of all resources de-allocation. Nevertheless, exactly for the reason you mentioned, that there may be some problems and that these problems may not be present only in that particular piece of code, I'll have a look into the function behavior. I suspect that it might be a matter of the order with which things are de-allocated. but I might be wrong. I'll come back on this. Thank you for your point, I will follow your recommendation. Ciao, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 06 August 2011 10:28 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Maurizio, Tcl_Finalize() is supposed to work, and if it does now work something is still broken in the windows version. Omitting Tcl_Finalize() is removeing the symptom, not the cause. It is not unlikely that something else will have the same problem due to this cause. When Tcl_Finalize() is not run, the registered exit handlers are not executed. How serious this is depends on the exit handlers. You are right, that the memory leak does not matter due to the shutdown. The difference is like between a graceful and an ungraceful shutdown. -gustaf On 05.08.11 16:29, Maurizio Martignano wrote: Dear Gustav, I understand your concerns about Tcl_Finalize. but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test.. Have Aolserver / nsd running on a big application. observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
YES. I do agree that executing or not executing the exit handlers may make a difference.. Just to help me in my troubleshooting can you tell me if and where these handlers are registered. I am digging into Tcl_Finalize.. J Thank you, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 06 August 2011 10:28 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Maurizio, Tcl_Finalize() is supposed to work, and if it does now work something is still broken in the windows version. Omitting Tcl_Finalize() is removeing the symptom, not the cause. It is not unlikely that something else will have the same problem due to this cause. When Tcl_Finalize() is not run, the registered exit handlers are not executed. How serious this is depends on the exit handlers. You are right, that the memory leak does not matter due to the shutdown. The difference is like between a graceful and an ungraceful shutdown. -gustaf On 05.08.11 16:29, Maurizio Martignano wrote: Dear Gustav, I understand your concerns about Tcl_Finalize. but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test.. Have Aolserver / nsd running on a big application. observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
It is me again. Well I noticed that the change I suggested about Tcl_Finalize did not make it into CVS HEAD. If it doesn't go there, I am afraid I will have to anyhow introduce it myself in my distribution. I need to have a working system. With that call still in, the service can't (CANNOT) be stopped gracefully. This is a matter of testing: Take the system, make it run with a real OpenACS based application (how about ]po[, or xowiki..) and see how it works and see how it interacts with the system. Does it start? Does it run? Does it stop properly? For the time being in Windows 64 that function needs to be out. Thanks a lot, Maurizio Thank you, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Gustaf Neumann Sent: 06 August 2011 10:28 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Maurizio, Tcl_Finalize() is supposed to work, and if it does now work something is still broken in the windows version. Omitting Tcl_Finalize() is removeing the symptom, not the cause. It is not unlikely that something else will have the same problem due to this cause. When Tcl_Finalize() is not run, the registered exit handlers are not executed. How serious this is depends on the exit handlers. You are right, that the memory leak does not matter due to the shutdown. The difference is like between a graceful and an ungraceful shutdown. -gustaf On 05.08.11 16:29, Maurizio Martignano wrote: Dear Gustav, I understand your concerns about Tcl_Finalize. but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test.. Have Aolserver / nsd running on a big application. observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Dossy, Your proposal of your wrapper sounds good to me. Why do not we insert that in the codebase? Till we understand better the issue? Next week I am going to redo some testing also in Win32 and I will let you know.. Thank you very much, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 06 August 2011 17:39 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Could you build AOLserver with debugging symbols and run nsd.exe under a debugger, with Tcl_Finalize *NOT* commented out/removed (i.e., as it currently is in CVS HEAD) and confirm where this 0x4015 exception is actually happening? Not calling Tcl_Finalize at process exit means any callbacks registered with Tcl_CreateExitHandler will not fire. It is absolutely wrong to not call Tcl_Finalize for this reason. If this is causing a problem on Win64 at the moment, as a temporary measure, you could wrap the call to Tcl_Finalize with the appropriate #ifndef: #if !defined(_WIN64) Tcl_Finalize(); #endif // !_WIN64 But, on all other platforms where invoking Tcl_Finalize does work, it should absolutely be done. On 8/6/11 9:35 AM, Maurizio Martignano wrote: Dear Gustav (and all the others) I did some digging. And here are the results.. 1. Tcl_Finalize gets properly called in Windows 64 by tclsh (ok tlcsh85t.exe) at exit time 2. From within Aolserver it doesn't even get actually called, but at the act of calling an exception is generated inside the C/C++ runtime: Faulting application name: nsd.exe, version: 0.0.0.0, time stamp: 0x4e3d1e32 Faulting module name: MSVCR100.dll, version: 10.0.30319.415, time stamp: 0x4d26d15a Exception code: 0x4015 Fault offset: 0x00075fe9 Faulting process id: 0x1114 Faulting application start time: 0x01cc542b82cdba6b Faulting application path: C:\aolserver\bin\nsd.exe Faulting module path: C:\Windows\system32\MSVCR100.dll Report Id: e90de38e-c01e-11e0-9d90-cef6f702c08b 3. Looking at the code in TCL I believe (and here I repeat I BELIEVE) the problem is in the TCL DLL initialization code: tclWin32Dll.c case DLL_PROCESS_DETACH: /* * Protect the call to Tcl_Finalize. The OS could be unloading us from * an exception handler and the state of the stack might be unstable. */ if defined(HAVE_NO_SEH) !defined(_WIN64) __asm__ __volatile__ ( /* * Construct an EXCEPTION_REGISTRATION to protect the call to * Tcl_Finalize */ leal %[registration], %%edx \n\t movl %%fs:0, %%eax\n\t movl %%eax,0x0(%%edx) \n\t /* link */ leal 1f, %%eax\n\t movl %%eax,0x4(%%edx) \n\t /* handler */ movl %%ebp,0x8(%%edx) \n\t /* ebp */ movl %%esp,0xc(%%edx) \n\t /* esp */ movl %[error], 0x10(%%edx) \n\t /* status */ /* * Link the EXCEPTION_REGISTRATION on the chain */ movl %%edx,%%fs:0 \n\t /* * Call Tcl_Finalize */ call _Tcl_Finalize\n\t /* * Come here on a normal exit. Recover the EXCEPTION_REGISTRATION * and store a TCL_OK status */ movl %%fs:0, %%edx\n\t movl %[ok],%%eax\n\t movl %%eax,0x10(%%edx) \n\t jmp2f \n /* * Come here on an exception. Get the EXCEPTION_REGISTRATION that * we previously put on the chain. */ 1:\t movl %%fs:0, %%edx\n\t movl 0x8(%%edx), %%edx\n /* * Come here however we exited. Restore context from the * EXCEPTION_REGISTRATION in case the stack is unbalanced. */ 2:\t movl 0xc(%%edx), %%esp\n\t movl 0x8(%%edx), %%ebp\n\t movl 0x0(%%edx), %%eax\n\t movl %%eax,%%fs:0 \n\t : /* No outputs */ : [registration] m (registration), [ok] i (TCL_OK), [error] i (TCL_ERROR) : %eax, %ebx, %ecx, %edx, %esi, %edi, memory ); #else #ifndef HAVE_NO_SEH __try { #endif Tcl_Finalize(); #ifndef HAVE_NO_SEH } __except (EXCEPTION_EXECUTE_HANDLER) { /* empty handler body. */ } #endif #endif break 4. My personal point of view a. This portion of code is too target specific, it uses assembly, some of these things may become obsolete or wrong when for instance moving
Re: [AOLSERVER] Aolserver Progress - Some few examples.... - Errata Corrige
Hello all I did some tests on Windows 32. Tcl_Finalize prevents the proper stopping of the service also on Windows 32. So the proper mod was and still is: // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Tcl_Finalize(); #endif Tcl_Finalize doesn't work also on the 32 bit code. Ciao, Maurizio Dear Dossy, Your proposal of your wrapper sounds good to me. Why do not we insert that in the codebase? Till we understand better the issue? Next week I am going to redo some testing also in Win32 and I will let you know.. Thank you very much, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 06 August 2011 17:39 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Could you build AOLserver with debugging symbols and run nsd.exe under a debugger, with Tcl_Finalize *NOT* commented out/removed (i.e., as it currently is in CVS HEAD) and confirm where this 0x4015 exception is actually happening? Not calling Tcl_Finalize at process exit means any callbacks registered with Tcl_CreateExitHandler will not fire. It is absolutely wrong to not call Tcl_Finalize for this reason. If this is causing a problem on Win64 at the moment, as a temporary measure, you could wrap the call to Tcl_Finalize with the appropriate #ifndef: #if !defined(_WIN64) Tcl_Finalize(); #endif // !_WIN64 But, on all other platforms where invoking Tcl_Finalize does work, it should absolutely be done. On 8/6/11 9:35 AM, Maurizio Martignano wrote: Dear Gustav (and all the others) I did some digging. And here are the results.. 1. Tcl_Finalize gets properly called in Windows 64 by tclsh (ok tlcsh85t.exe) at exit time 2. From within Aolserver it doesn't even get actually called, but at the act of calling an exception is generated inside the C/C++ runtime: Faulting application name: nsd.exe, version: 0.0.0.0, time stamp: 0x4e3d1e32 Faulting module name: MSVCR100.dll, version: 10.0.30319.415, time stamp: 0x4d26d15a Exception code: 0x4015 Fault offset: 0x00075fe9 Faulting process id: 0x1114 Faulting application start time: 0x01cc542b82cdba6b Faulting application path: C:\aolserver\bin\nsd.exe Faulting module path: C:\Windows\system32\MSVCR100.dll Report Id: e90de38e-c01e-11e0-9d90-cef6f702c08b 3. Looking at the code in TCL I believe (and here I repeat I BELIEVE) the problem is in the TCL DLL initialization code: tclWin32Dll.c case DLL_PROCESS_DETACH: /* * Protect the call to Tcl_Finalize. The OS could be unloading us from * an exception handler and the state of the stack might be unstable. */ if defined(HAVE_NO_SEH) !defined(_WIN64) __asm__ __volatile__ ( /* * Construct an EXCEPTION_REGISTRATION to protect the call to * Tcl_Finalize */ leal %[registration], %%edx \n\t movl %%fs:0, %%eax\n\t movl %%eax,0x0(%%edx) \n\t /* link */ leal 1f, %%eax\n\t movl %%eax,0x4(%%edx) \n\t /* handler */ movl %%ebp,0x8(%%edx) \n\t /* ebp */ movl %%esp,0xc(%%edx) \n\t /* esp */ movl %[error], 0x10(%%edx) \n\t /* status */ /* * Link the EXCEPTION_REGISTRATION on the chain */ movl %%edx,%%fs:0 \n\t /* * Call Tcl_Finalize */ call _Tcl_Finalize\n\t /* * Come here on a normal exit. Recover the EXCEPTION_REGISTRATION * and store a TCL_OK status */ movl %%fs:0, %%edx\n\t movl %[ok],%%eax\n\t movl %%eax,0x10(%%edx) \n\t jmp2f \n /* * Come here on an exception. Get the EXCEPTION_REGISTRATION that * we previously put on the chain. */ 1:\t movl %%fs:0, %%edx\n\t movl 0x8(%%edx), %%edx\n /* * Come here however we exited. Restore context from the * EXCEPTION_REGISTRATION in case the stack is unbalanced. */ 2:\t movl 0xc(%%edx), %%esp\n\t movl 0x8(%%edx), %%ebp\n\t movl 0x0(%%edx), %%eax\n\t movl %%eax,%%fs:0 \n\t : /* No outputs */ : [registration] m (registration), [ok] i (TCL_OK), [error] i (TCL_ERROR) : %eax, %ebx, %ecx, %edx, %esi, %edi, memory ); #else
Re: [AOLSERVER] Aolserver Progress - Some few examples.... - Errata Corrige
I vaguely remember never figuring this out either and deciding to ifdef it out. In practice it doesn't do much -- I've never come across a on-exit handler that really needed fire. Curious if anyone has. Jim Sent from a phone On Aug 6, 2011, at 3:29 PM, Maurizio Martignano maurizio.martign...@spazioit.com wrote: Hello all I did some tests on Windows 32. Tcl_Finalize prevents the proper stopping of the service also on Windows 32. So the proper mod was and still is: // Conditional compilation clause added by M. Martignano on the 05/08/2011 #ifndef _WIN32 Tcl_Finalize(); #endif Tcl_Finalize doesn’t work also on the 32 bit code. Ciao, Maurizio Dear Dossy, Your proposal of your wrapper sounds good to me. Why do not we insert that in the codebase? Till we understand better the issue? Next week I am going to redo some testing also in Win32 and I will let you know…. Thank you very much, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 06 August 2011 17:39 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Could you build AOLserver with debugging symbols and run nsd.exe under a debugger, with Tcl_Finalize *NOT* commented out/removed (i.e., as it currently is in CVS HEAD) and confirm where this 0x4015 exception is actually happening? Not calling Tcl_Finalize at process exit means any callbacks registered with Tcl_CreateExitHandler will not fire. It is absolutely wrong to not call Tcl_Finalize for this reason. If this is causing a problem on Win64 at the moment, as a temporary measure, you could wrap the call to Tcl_Finalize with the appropriate #ifndef: #if !defined(_WIN64) Tcl_Finalize(); #endif // !_WIN64 But, on all other platforms where invoking Tcl_Finalize does work, it should absolutely be done. On 8/6/11 9:35 AM, Maurizio Martignano wrote: Dear Gustav (and all the others) I did some digging… And here are the results…. 1. Tcl_Finalize gets properly called in Windows 64 by tclsh (ok tlcsh85t.exe) at exit time 2. From within Aolserver it doesn’t even get actually called, but at the act of calling an exception is generated inside the C/C++ runtime: Faulting application name: nsd.exe, version: 0.0.0.0, time stamp: 0x4e3d1e32 Faulting module name: MSVCR100.dll, version: 10.0.30319.415, time stamp: 0x4d26d15a Exception code: 0x4015 Fault offset: 0x00075fe9 Faulting process id: 0x1114 Faulting application start time: 0x01cc542b82cdba6b Faulting application path: C:\aolserver\bin\nsd.exe Faulting module path: C:\Windows\system32\MSVCR100.dll Report Id: e90de38e-c01e-11e0-9d90-cef6f702c08b 3. Looking at the code in TCL I believe (and here I repeat I BELIEVE) the problem is in the TCL DLL initialization code: tclWin32Dll.c case DLL_PROCESS_DETACH: /* * Protect the call to Tcl_Finalize. The OS could be unloading us from * an exception handler and the state of the stack might be unstable. */ if defined(HAVE_NO_SEH) !defined(_WIN64) __asm__ __volatile__ ( /* * Construct an EXCEPTION_REGISTRATION to protect the call to * Tcl_Finalize */ leal %[registration], %%edx \n\t movl %%fs:0, %%eax\n\t movl %%eax,0x0(%%edx) \n\t /* link */ leal 1f, %%eax\n\t movl %%eax,0x4(%%edx) \n\t /* handler */ movl %%ebp,0x8(%%edx) \n\t /* ebp */ movl %%esp,0xc(%%edx) \n\t /* esp */ movl %[error], 0x10(%%edx) \n\t /* status */ /* * Link the EXCEPTION_REGISTRATION on the chain */ movl %%edx,%%fs:0 \n\t /* * Call Tcl_Finalize */ call _Tcl_Finalize\n\t /* * Come here on a normal exit. Recover the EXCEPTION_REGISTRATION * and store a TCL_OK status */ movl %%fs:0, %%edx\n\t movl %[ok],%%eax\n\t movl %%eax,0x10(%%edx) \n\t jmp2f \n /* * Come here on an exception. Get the EXCEPTION_REGISTRATION that * we previously put on the chain. */ 1:\t movl %%fs:0, %%edx\n\t movl 0x8(%%edx), %%edx\n /* * Come here however we exited. Restore context
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Maurizio and all... i have updated cvs on sourceforge with most of your patches. A few points are questionable (see below). For me, it is still unclear, why 4.5.1 worked for you, but not the head version not. As far i can see, all socket usages were int the same way in 4.5.1, the variable triggers in nsd.h was defined like this at least since 2004. Maybe it was luck that the win version worked in 4.5.1 (different memory layout, different compilers / compiler options, ...) A few comments to the patches (i have omitted these): nsd/nsmain.c +#ifndef _WIN32 Tcl_Finalize(); +#endif === If one does no Tcl_Finalize() one introduces a memory leak. nsproxy/nsproxy.c -Tcl_FindExecutable(argv[0]); === The call to Tcl_FindExecutable() is required (at least in Tcl 8.5), otherwise tcl will crash (at least under unix like operating systems) +#define uint32_t unsigned long +#define uint16_t unsigned short + +typedef void * caddr_t; === These defines should be most probably within an #ifdef static void -FatalExit(char *func) +NSP_FatalExit(char *func) === What's wrong with the static name FatalExit()? -static Proc *firstClosePtr = NULL; +static Proc *firstClosePtr; === What's wrong with the initialization of the static variable? I have not updated the nsproxy changes, since these need more work. -gustaf neumann On 05.08.11 08:14, Maurizio Martignano wrote: Dear all, here you are with a first patch file and the zip containing the code base I'm using. The nspd module requires more work, but I'm not using it. The files in the zip archive do compile and seems to be working Windows 32 and Windows 64. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Gustav, Thank you so much for you feedback. I just distributed a new mail with an explanation for the patches.. Sorry if it arrives too late.. I will answers your questions here below. Once again, sorry for the bad timing. Ciao, Maurizio From: Gustaf Neumann [mailto:neum...@wu-wien.ac.at] Sent: 05 August 2011 14:23 To: AOLserver Discussion Cc: Maurizio Martignano Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Dear Maurizio and all... i have updated cvs on sourceforge with most of your patches. A few points are questionable (see below). For me, it is still unclear, why 4.5.1 worked for you, but not the head version not. As far i can see, all socket usages were int the same way in 4.5.1, the variable triggers in nsd.h was defined like this at least since 2004. Maybe it was luck that the win version worked in 4.5.1 (different memory layout, different compilers / compiler options, ...) [MM] No.. Just Alzheimer. Me. When I first did the compilation I spotted the problem and I fixed it by changing int trigger[2] into SOCKET trigger[2]. Then I forgot completely about it.. Then the issue showed up again... when I downloaded the code again.. A few comments to the patches (i have omitted these): nsd/nsmain.c +#ifndef _WIN32 Tcl_Finalize(); +#endif [MM] As simple as that: TCL_Finalize never ends on Windows, so it prevents the process/service to stop properly. === If one does no Tcl_Finalize() one introduces a memory leak. [MM] The process/service is about to end anyhow. I believe that mo matter what the poor process/service does all its memory will be released by the OS. So this is not an issue. nsproxy/nsproxy.c -Tcl_FindExecutable(argv[0]); === The call to Tcl_FindExecutable() is required (at least in Tcl 8.5), otherwise tcl will crash (at least under unix like operating systems) [MM] Not my change, please look at my newest email and sorry if I cause you some inconvenience. same situations for the following changes.. Sorry... +#define uint32_t unsigned long +#define uint16_t unsigned short + +typedef void * caddr_t; === These defines should be most probably within an #ifdef static void -FatalExit(char *func) +NSP_FatalExit(char *func) === What's wrong with the static name FatalExit()? -static Proc *firstClosePtr = NULL; +static Proc *firstClosePtr; === What's wrong with the initialization of the static variable? [MM] absolutely nothing.. May be my bad usage of patch, again apologies. I have not updated the nsproxy changes, since these need more work. [MM] Perfect -gustaf neumann On 05.08.11 08:14, Maurizio Martignano wrote: Dear all, here you are with a first patch file and the zip containing the code base I'm using. The nspd module requires more work, but I'm not using it. The files in the zip archive do compile and seems to be working Windows 32 and Windows 64. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Maurizio, i guess, everything is fine with you with the head version on sourceforge. For me, it is still unclear, why 4.5.1 worked for you, but not the head version not. As far i can see, all socket usages were int the same way in 4.5.1, the variable triggers in nsd.h was defined like this at least since 2004. Maybe it was luck that the win version worked in 4.5.1 (different memory layout, different compilers / compiler options, ...) [MM] No Just Alzheimer... Me. When I first did the compilation I spotted the problem and I fixed it by changing int trigger[2] into SOCKET trigger[2]. Then I forgot completely about it Then the issue showed up again. when I downloaded the code again ok, this explains it. === If one does no Tcl_Finalize() one introduces a memory leak. [MM] The process/service is about to end anyhow. I believe that mo matter what the poor process/service does all its memory will be released by the OS. So this is not an issue. Tcl_finalize shuts down Tcl; it calls the registered exit handlers and then it shuts down various Tcl subsystems. It is certainly not recommended to to omit, but i have not checked the exact consequences for aolserver. If it hangs, it is an indication that there is still something wrong in tcl and/or aolserver. Keep an eye open in this respect. nsproxy/nsproxy.c -Tcl_FindExecutable(argv[0]); === The call to Tcl_FindExecutable() is required (at least in Tcl 8.5), otherwise tcl will crash (at least under unix like operating systems) [MM] Not my change, please look at my newest email and sorry if I cause you some inconvenience. It was included in your first patch (maybe erratic). If this is not needed, fine. All the best, and many thanks for the feedback -gustaf neumann -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
On Fri, Aug 05, 2011 at 02:22:44PM +0200, Gustaf Neumann wrote: For me, it is still unclear, why 4.5.1 worked for you, but not the head version not. As far i can see, all socket usages were int the same way in 4.5.1, the variable triggers in nsd.h was defined like this at least since 2004. Maurizio explained that earlier: He had misremembered, and actually DID have to make the int to SOCKET changes in the earlier 4.5.1 version as well for it to work on Win64. And someone else (Dossy I think) explained why that makes sense: The definition of SOCKET is different on Win64. So all these versions of AOLserver have been working ok on 32 bit Windows, but were presumably broken on 64 bit Windows all along. -- Andrew Piskorski a...@piskorski.com http://www.piskorski.com/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Gustav, I understand your concerns about Tcl_Finalize. but it is called just when the process/service is about to end. Once it ends the OS takes charges and releases the process/service resources (memory included). You can make an easy test.. Have Aolserver / nsd running on a big application. observe the OS resources given to the process and released when I finishes. Do this twice: with Tcl_Finalize on and Tcl_Finalize commented out. And see if you can find any difference. Ciao, Maurizio From: Gustaf Neumann [mailto:neum...@wu-wien.ac.at] Sent: 05 August 2011 15:52 To: Maurizio Martignano Cc: 'AOLserver Discussion' Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Dear Maurizio, i guess, everything is fine with you with the head version on sourceforge. For me, it is still unclear, why 4.5.1 worked for you, but not the head version not. As far i can see, all socket usages were int the same way in 4.5.1, the variable triggers in nsd.h was defined like this at least since 2004. Maybe it was luck that the win version worked in 4.5.1 (different memory layout, different compilers / compiler options, ...) [MM] No.. Just Alzheimer. Me. When I first did the compilation I spotted the problem and I fixed it by changing int trigger[2] into SOCKET trigger[2]. Then I forgot completely about it.. Then the issue showed up again... when I downloaded the code again.. ok, this explains it. === If one does no Tcl_Finalize() one introduces a memory leak. [MM] The process/service is about to end anyhow. I believe that mo matter what the poor process/service does all its memory will be released by the OS. So this is not an issue. Tcl_finalize shuts down Tcl; it calls the registered exit handlers and then it shuts down various Tcl subsystems. It is certainly not recommended to to omit, but i have not checked the exact consequences for aolserver. If it hangs, it is an indication that there is still something wrong in tcl and/or aolserver. Keep an eye open in this respect. nsproxy/nsproxy.c -Tcl_FindExecutable(argv[0]); === The call to Tcl_FindExecutable() is required (at least in Tcl 8.5), otherwise tcl will crash (at least under unix like operating systems) [MM] Not my change, please look at my newest email and sorry if I cause you some inconvenience. It was included in your first patch (maybe erratic). If this is not needed, fine. All the best, and many thanks for the feedback -gustaf neumann -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear all, Id like to provide you with very few examples to explain what I was talking about: These problems manifested themselves in the Win64 version driver.c void NsWaitDriversShutdown(Ns_Time *toPtr) { Driver *drvPtr = firstDrvPtr; int status = NS_OK; while (drvPtr != NULL) { Ns_MutexLock(drvPtr-lock); while (!(drvPtr-flags DRIVER_STOPPED) status == NS_OK) { status = Ns_CondTimedWait(drvPtr-cond, drvPtr-lock, toPtr); } Ns_MutexUnlock(drvPtr-lock); if (status != NS_OK) { Ns_Log(Warning, driver: shutdown timeout: %s, drvPtr-module); } else { Ns_Log(Notice, driver: stopped: %s, drvPtr-module); Ns_ThreadJoin(drvPtr-thread, NULL);ß WAITS FOREVER drvPtr-thread = NULL; } drvPtr = drvPtr-nextPtr; } } And then: static void TriggerDriver(Driver *drvPtr) { if (send(drvPtr-trigger[1], , 1, 0) != 1) { ß ALWAYS ALWAYS RETURNS AN ERROR Ns_Fatal(driver: trigger send() failed: %s, ns_sockstrerror(ns_sockerrno)); } } Ns.h typedef struct Driver { /* * Visible in Ns_Driver. */ void *arg; /* Driver callback data. */ char *server; /* Virtual server name. */ char *module;/* Driver module. */ char*name;/* Driver name, e.g., nssock. */ char*location; /* Location, e.g, http://foo:9090; */ char*address; /* Address in location. */ intsendwait; /* send() I/O timeout. */ intrecvwait;/* recv() I/O timeout. */ int bufsize; /* Conn bufsize (0 for SSL) */ int sndbuf; /* setsockopt() SNDBUF option. */ int rcvbuf; /* setsockopt() RCVBUF option. */ /* * Private to Driver. */ struct Driver *nextPtr; /* Next in list of drivers. */ struct NsServer *servPtr; /* Driver virtual server. */ char *fullname; /* Full name, i.e., server/module. */ int flags; /* Driver state flags. */ Ns_Thread thread;/* Thread id to join on shutdown. */ Ns_Mutex lock; /* Lock to protect lists below. */ Ns_Cond cond;/* Cond to signal reader threads, * driver query, startup, and shutdown. */ inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) Ns_DriverProc *proc; /* Driver callback. */ int opts; /* Driver options. */ etc . I have the feeling that we are not facing Windows specific stuff, but somehow some general errors, mistakes that happen to manifest themselves only on Windows (64). Hope it clarifies the situation, Maurizio -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
On Aug 4, 2011, at 12:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) A Unix pipe is just a pair of file descriptors, and a file descriptor in Unix is just an integer. Windows pipes are implemented differently, of course, and the semantics aren't exactly the same, either. Can you tell from CVS who put this code in? I'm sure it was done from ignorance of Windows vs. Unix differences regarding pipes, not intentionally. I have the feeling that we are not facing Windows specific stuff, but somehow some general errors, mistakes that happen to manifest themselves only on Windows (64). Not in this case, no, that's perfectly reasonable Unix code. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
It's probably safer to define this as SOCKET, but windows.h says SOCKET is: typedef u_int SOCKET; And: typedef unsigned intu_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ßWhy is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Don, I went back to my archives This is the situation: 1. the code in CVS had always int trigger[2]; 2. I took the version 4.5.1 from the tar ball dated 2009-02-02 and I did the change SOCKET int trigger[2]; to make it work 3. then I recently took the Aolserver code from CVS Head and forgot to make the above change and so I started to observe problems in the networking code 4. re-inserted the change and everything seems to work... but I will test it and very deeply. 5. I have to disagree with your statement A Unix pipe is just a pair of file descriptors, and a file descriptor in Unix is just an integer. If I look at the code base (and please do the same with me)... check nscp/nscp.c nsd/binder.c, fd.c, listen.c, sock.c, tclfile.c, tclhttp.c, urlopen.c nsext/nsext.c nspd/nspd.c nsproxy/nsproxylib.c nssock/nssock.c nssl/nssl.c Well not always sockets are declared/defines as SOCKET as they should be (and this I am afraid also in Unix) This is a problem of proper data type selection and usage, it is mostly a consistency problem. I would humbly suggest that one of the code maintainers takes a walk on the code base and makes sure that everywhere we need a socket we have a real SOCKET socket and not an int socket. The code will be more consistent and more portable to Windows. Ciao, Maurizio PS: the attached text file shows where the keyword SOCKET is currently used... -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 14:53 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 12:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) A Unix pipe is just a pair of file descriptors, and a file descriptor in Unix is just an integer. Windows pipes are implemented differently, of course, and the semantics aren't exactly the same, either. Can you tell from CVS who put this code in? I'm sure it was done from ignorance of Windows vs. Unix differences regarding pipes, not intentionally. I have the feeling that we are not facing Windows specific stuff, but somehow some general errors, mistakes that happen to manifest themselves only on Windows (64). Not in this case, no, that's perfectly reasonable Unix code. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. * Socket descriptor or INVALID_SOCKET on error. SOCKET SOCKET sock = INVALID_SOCKET; ./binder.c SOCKET sock; static Sock *SockAccept(SOCKET lsock, Driver *drvPtr); static int Poll(PollData *pdataPtr, SOCKET sock, int events, Ns_Time *timeoutPtr); Ns_QueueWait(Ns_Conn *conn, SOCKET sock, Ns_QueueWaitProc *proc, SOCKET lsock; if (lsock != INVALID_SOCKET) { if (lsock != INVALID_SOCKET) { Poll(PollData *pdataPtr, SOCKET sock, int events, Ns_Time *timeoutPtr) SockAccept(SOCKET lsock, Driver *drvPtr) if (sockPtr-sock == INVALID_SOCKET) { setsockopt(sockPtr-sock, SOL_SOCKET, SO_SNDBUF, setsockopt(sockPtr-sock, SOL_SOCKET, SO_RCVBUF, sockPtr-sock = INVALID_SOCKET; ./driver.c ns_sockpair(SOCKET *socks) SOCKET sock; if (sock == INVALID_SOCKET || if (socks[1] == INVALID_SOCKET || if (socks[0] == INVALID_SOCKET) { ./fd.c SOCKET new, sock; if (sock == INVALID_SOCKET) { if (sock == INVALID_SOCKET) { ListenProc(SOCKET sock, void *arg, int why) SOCKET new; if (new != INVALID_SOCKET) { ./listen.c * 0 or SOCKET_ERROR. ns_socknbclose(SOCKET sock) return SOCKET_ERROR; SOCKET ns_sockdup(SOCKET sock) return INVALID_SOCKET; return (SOCKET) dup; ./nswin32.c static SOCKET SockConnect(char *host, int port, char *lhost, int lport, int async); static SOCKET SockSetup(SOCKET sock); Ns_SockRecv(SOCKET sock, void *buf, int toread, int timeout) Ns_SockSend(SOCKET sock, void *buf, int towrite, int timeout) Ns_SockWait(SOCKET sock, int what, int seconds) Ns_SockWaitEx(SOCKET sock, int what, int ms) SOCKET SOCKET SOCKET sock; if (sock == INVALID_SOCKET) { if (sock != INVALID_SOCKET listen(sock, backlog) != 0) { sock = INVALID_SOCKET; SOCKET Ns_SockAccept(SOCKET lsock, struct sockaddr *saPtr, int *lenPtr) SOCKET sock; if (sock != INVALID_SOCKET) { SOCKET SOCKET SOCKET sock; if (sock != INVALID_SOCKET
Re: [AOLSERVER] Aolserver Progress - Some few examples....
It is not a matter of understanding It is a matter of testing On Windows 64 int trigger[2] doesnt work whereas SOCKET trigger[2] does work. On top of that in several other places SOCKET has been used, so if for no other reason, I suggest one of the code maintainers takes a proper walk on the code base and make sure that all sockets are SOCKET sockets and not int sockets Ciao, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 04 August 2011 15:51 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples It's probably safer to define this as SOCKET, but windows.h says SOCKET is: typedef u_int SOCKET; And: typedef unsigned intu_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
On Win64, can you tell me what sizeof(SOCKET) and sizeof(int) are? Try this simple program: #include windows.h #include winsock2.h int main(int argc, char[] *argv) { printf(sizeof(SOCKET) = %d, sizeof(int) = %d\n, sizeof(SOCKET), sizeof(int)); return 0; } I just learned that on Win64, Microsoft *changed* the definition of SOCKET from u_int to UINT_PTR: /* * The new type to be used in all * instances which refer to sockets. */ #ifdef _WIN64 typedef UINT_PTRSOCKET; #else typedef u_int SOCKET; #endif Which means 64-bit SOCKET on Win64 vs. 32-bit SOCKET on Win32 or most Unix-like systems. ... The short answer is, yes, anywhere we have a variable that contains a handle to a socket, we should use the SOCKET type, not a naked int declaration, for portability. On 8/4/11 10:28 AM, Maurizio Martignano wrote: It is not a matter of understanding It is a matter of testing On Windows 64 int trigger[2] doesn't work whereas SOCKET trigger[2] does work. On top of that in several other places SOCKET has been used, so if for no other reason, I suggest one of the code maintainers takes a proper walk on the code base and make sure that all sockets are SOCKET sockets and not int sockets... -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dossy, It is irrelevant... Absolutely irrelevant.. With int trigger[2] static void TriggerDriver(Driver *drvPtr) { if (send(drvPtr-trigger[1], , 1, 0) != 1) { The send doesn't work and always returns error With SOCKET trigger[2]; It DOES Work... Back to your question: The program should be: #include windows.h #include winsock.h int main(int argc, char* argv[]) { printf(sizeof(SOCKET) = %d, sizeof(int) = %d\n, sizeof(SOCKET), sizeof(int)); return 0; } Its output when compiled as Windows 64 is: c:\Itmpcl test.c Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 Copyright (C) Microsoft Corporation. All rights reserved. test.c Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:test.exe test.obj c:\Itmptest sizeof(SOCKET) = 8, sizeof(int) = 4 and when compiled with Windows 32 C:\Itmpcl test.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. test.c Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:test.exe test.obj C:\Itmptest sizeof(SOCKET) = 4, sizeof(int) = 4 C:\Itmp I hope you understand my point now (thank you for your educational example which just proves it.) NOW BACK TO US 1. The Aolserver code base inconsistently uses int and SOCKET when declaring /defining variables to be used as Sockets. 2. This inconsistency it is not a Windows/Unix problem - it is just a plain inconsistency 3. We are just lucky that Windows 64 exposed the problem. 4. I do recommend that one of the code maintainers takes a walk on code base and makes all the sockets declarations/definitions consistent. Thank you, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 04 August 2011 16:56 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Win64, can you tell me what sizeof(SOCKET) and sizeof(int) are? Try this simple program: #include windows.h #include winsock2.h int main(int argc, char[] *argv) { printf(sizeof(SOCKET) = %d, sizeof(int) = %d\n, sizeof(SOCKET), sizeof(int)); return 0; } I just learned that on Win64, Microsoft *changed* the definition of SOCKET from u_int to UINT_PTR: /* * The new type to be used in all * instances which refer to sockets. */ #ifdef _WIN64 typedef UINT_PTRSOCKET; #else typedef u_int SOCKET; #endif Which means 64-bit SOCKET on Win64 vs. 32-bit SOCKET on Win32 or most Unix-like systems. ... The short answer is, yes, anywhere we have a variable that contains a handle to a socket, we should use the SOCKET type, not a naked int declaration, for portability. On 8/4/11 10:28 AM, Maurizio Martignano wrote: It is not a matter of understanding It is a matter of testing On Windows 64 int trigger[2] doesn't work whereas SOCKET trigger[2] does work. On top of that in several other places SOCKET has been used, so if for no other reason, I suggest one of the code maintainers takes a proper walk on the code base and make sure that all sockets are SOCKET sockets and not int sockets. -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
On Aug 4, 2011, at 7:20 AM, Maurizio Martignano wrote: 5. I have to disagree with your statement A Unix pipe is just a pair of file descriptors, and a file descriptor in Unix is just an integer. Feel free to disagree with the official Linux documentation then: http://www.kernel.org/doc/man-pages/online/pages/man2/pipe.2.html Note int pipefd[2] file descriptors in Unix are integers. Dossy says this is the same in Windows (I wouldn't know), perhaps the problem lies in the semantics, IIRC windows doesn't support anonymous pipes, for instance. (But I could be wrong about that … but I'm not wrong about Unix fds being ints) Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Don, If you follow the last discussions even Dossy agrees that a SOCKET is not an int on Windows 64 All of this depends on the week type system of C, were types with different names, supposed to be used for different needs are considered equivalent is their size is the same. If we had used Ada none of this would have had happened: types with different names are different no matter what their size is. Anyhow in the base code 95% of the times or even more sockets are declared as SOCKET sockets. Here and there they are declared as int. This is an inconsistency and it should be removed. I do beg the community to do this little change because it is in the benefit and interest of everybody. Hope it helps, Maurizio -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 18:07 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 7:20 AM, Maurizio Martignano wrote: 5. I have to disagree with your statement A Unix pipe is just a pair of file descriptors, and a file descriptor in Unix is just an integer. Feel free to disagree with the official Linux documentation then: http://www.kernel.org/doc/man-pages/online/pages/man2/pipe.2.html Note int pipefd[2] file descriptors in Unix are integers. Dossy says this is the same in Windows (I wouldn't know), perhaps the problem lies in the semantics, IIRC windows doesn't support anonymous pipes, for instance. (But I could be wrong about that . but I'm not wrong about Unix fds being ints) Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
On Aug 4, 2011, at 9:55 AM, Maurizio Martignano wrote: All of this depends on the week type system of C, were types with different names, supposed to be used for different needs are considered equivalent is their size is the same. If we had used Ada none of this would have had happened: types with different names are different no matter what their size is. If we were using Ada a file descriptor in Unix would still be described as an integer. I'm not saying that the Unix code you've uncovered is portable between Unix and Windows. I'm just pointing out that pipes are defined as an array of two integers in Unix, so that the code isn't wrong for Unix, as you originally claimed. I did so hoping it would increase your understanding, i.e. your claim that it appears to be a bug even in Unix is incorrect. If you want to make progress here, just accept that the code is perfectly good Unix code and then figure out how to make the code work for both Unix and Windows, instead of trying to argue incorrectly that the code's not correct for Unix. It's not portable, but it's correct for Unix. Thank you. Anyhow in the base code 95% of the times or even more sockets are declared as SOCKET sockets. Here and there they are declared as int. This is an inconsistency and it should be removed. I do beg the community to do this little change because it is in the benefit and interest of everybody. I'm sure that the community will accept a patch that declares the pipe in a way that makes both Unix and Windows happy if you'll provide one. Meanwhile, quit complaining because I pointed out that, in Unix, int pipefd[2] is the correct declaration for a pipe. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dossy Shiobara wrote: It's probably safer to define this as SOCKET, but windows.h says SOCKET is: The source comment is misleading, because trigger is set up as a socket pair, not as a pipe. Not sure why it's this way, but there it is. And ns_sockpair is already prototyped as ns_sockpair(SOCKET *socks) so if this is a problem it really should be triggering a compiler warning about it. In any case, since unix defines SOCKET as int, it should make zero difference on the unix side to change the structure definition. -J typedef u_int SOCKET; And: typedef unsigned int u_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: int trigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/| can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Don In Aolserver source code 95% of more of the times sockets are declared as SOCKET; the other times as int. This is an inconsistency and is a fact. If you wanted to develop only for Unix why did you use SOCKET in some occasions and int in some others? The source code is inconsistent and it just happens to work on Unix because there SOCKET and int have the same size. And this is also a fact. But I believe we should stop here, I admit all the faults you want, but please let's use SOCKET everywhere Cheers, Maurizio -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 19:25 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 9:55 AM, Maurizio Martignano wrote: All of this depends on the week type system of C, were types with different names, supposed to be used for different needs are considered equivalent is their size is the same. If we had used Ada none of this would have had happened: types with different names are different no matter what their size is. If we were using Ada a file descriptor in Unix would still be described as an integer. I'm not saying that the Unix code you've uncovered is portable between Unix and Windows. I'm just pointing out that pipes are defined as an array of two integers in Unix, so that the code isn't wrong for Unix, as you originally claimed. I did so hoping it would increase your understanding, i.e. your claim that it appears to be a bug even in Unix is incorrect. If you want to make progress here, just accept that the code is perfectly good Unix code and then figure out how to make the code work for both Unix and Windows, instead of trying to argue incorrectly that the code's not correct for Unix. It's not portable, but it's correct for Unix. Thank you. Anyhow in the base code 95% of the times or even more sockets are declared as SOCKET sockets. Here and there they are declared as int. This is an inconsistency and it should be removed. I do beg the community to do this little change because it is in the benefit and interest of everybody. I'm sure that the community will accept a patch that declares the pipe in a way that makes both Unix and Windows happy if you'll provide one. Meanwhile, quit complaining because I pointed out that, in Unix, int pipefd[2] is the correct declaration for a pipe. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Hi It's a socket so it can be monitored by select and poll. It should be SOCKET, I think it was in the past. On windows lib-c file handles returned by _open aren't the same as sockets. You can see this in the libc source Microsoft provides. They can't be monitored with select. The ns_sockpair is a pipe-like thing on windows by using socket calls to actually listen and connect on a localhost network socket. Net: seems I does need to change to SOCKET and that should have no effect on unix. Warning: I'm going on memory, not looking at the code. Jim Sent from a phone On Aug 4, 2011, at 11:34 AM, Jeff Rogers dv...@diphi.com wrote: Dossy Shiobara wrote: It's probably safer to define this as SOCKET, but windows.h says SOCKET is: The source comment is misleading, because trigger is set up as a socket pair, not as a pipe. Not sure why it's this way, but there it is. And ns_sockpair is already prototyped as ns_sockpair(SOCKET *socks) so if this is a problem it really should be triggering a compiler warning about it. In any case, since unix defines SOCKET as int, it should make zero difference on the unix side to change the structure definition. -J typedef u_int SOCKET; And: typedef unsigned int u_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: int trigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/| can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Maurizio, I think we're all in agreement at this point. Could you put together a patch? -J Maurizio Martignano wrote: Don In Aolserver source code 95% of more of the times sockets are declared as SOCKET; the other times as int. This is an inconsistency and is a fact. If you wanted to develop only for Unix why did you use SOCKET in some occasions and int in some others? The source code is inconsistent and it just happens to work on Unix because there SOCKET and int have the same size. And this is also a fact. But I believe we should stop here, I admit all the faults you want, but please let's use SOCKET everywhere Cheers, Maurizio -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 19:25 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 9:55 AM, Maurizio Martignano wrote: All of this depends on the week type system of C, were types with different names, supposed to be used for different needs are considered equivalent is their size is the same. If we had used Ada none of this would have had happened: types with different names are different no matter what their size is. If we were using Ada a file descriptor in Unix would still be described as an integer. I'm not saying that the Unix code you've uncovered is portable between Unix and Windows. I'm just pointing out that pipes are defined as an array of two integers in Unix, so that the code isn't wrong for Unix, as you originally claimed. I did so hoping it would increase your understanding, i.e. your claim that it appears to be a bug even in Unix is incorrect. If you want to make progress here, just accept that the code is perfectly good Unix code and then figure out how to make the code work for both Unix and Windows, instead of trying to argue incorrectly that the code's not correct for Unix. It's not portable, but it's correct for Unix. Thank you. Anyhow in the base code 95% of the times or even more sockets are declared as SOCKET sockets. Here and there they are declared as int. This is an inconsistency and it should be removed. I do beg the community to do this little change because it is in the benefit and interest of everybody. I'm sure that the community will accept a patch that declares the pipe in a way that makes both Unix and Windows happy if you'll provide one. Meanwhile, quit complaining because I pointed out that, in Unix, int pipefd[2] is the correct declaration for a pipe. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email tolists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
We are reasoning too much... 1. Compiling the code on Windows 64 made clear there's some inconsistency in the code... 2. This inconsistence is on how sockets are declared: 95% and more of the times as SOCKET and the rest of the times as int 3. On UNIX and WIN32 no problem cause SOCKET and int have the same size 4. On WIN64 there's a problem cause SOCKET and int do not have the same size and the helpful example Dossy made and I compiled on Win32 and Win34 elegantly shows that. 5. We have a good opportunity to clean the code, making it more consistent and more portable... 6. I insist on the need to make this little walk on the code base to make it consistent... We should use everywhere SOCKET. What are we waiting for? :-) :-) :-) -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Jim Davidson Sent: 04 August 2011 20:22 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Hi It's a socket so it can be monitored by select and poll. It should be SOCKET, I think it was in the past. On windows lib-c file handles returned by _open aren't the same as sockets. You can see this in the libc source Microsoft provides. They can't be monitored with select. The ns_sockpair is a pipe-like thing on windows by using socket calls to actually listen and connect on a localhost network socket. Net: seems I does need to change to SOCKET and that should have no effect on unix. Warning: I'm going on memory, not looking at the code. Jim Sent from a phone On Aug 4, 2011, at 11:34 AM, Jeff Rogers dv...@diphi.com wrote: Dossy Shiobara wrote: It's probably safer to define this as SOCKET, but windows.h says SOCKET is: The source comment is misleading, because trigger is set up as a socket pair, not as a pipe. Not sure why it's this way, but there it is. And ns_sockpair is already prototyped as ns_sockpair(SOCKET *socks) so if this is a problem it really should be triggering a compiler warning about it. In any case, since unix defines SOCKET as int, it should make zero difference on the unix side to change the structure definition. -J typedef u_int SOCKET; And: typedef unsigned int u_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: int trigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/| can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Dear Rusty, I started very politely, gently... Stressing I was seeing that the code base was kind of separating, moving away from Windows support... (I did see how SOCKETwere used). Then I provided the examples Then I stressed the int trigger[2]; Then I made it clear and I am sorry that this was seen as a porting issue and not as an inconsistency... so I stressed again I am sorry if I have been... well as you describe in your mail but at least the point has been made Thank you. Maurizio -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Rusty Brooks Sent: 04 August 2011 20:55 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Fine, SOCKET should be used everywhere. But also, you're kind of being a dick. Don't do that. Rusty On Aug 4, 2011, at 1:26 PM, Maurizio Martignano wrote: Don In Aolserver source code 95% of more of the times sockets are declared as SOCKET; the other times as int. This is an inconsistency and is a fact. If you wanted to develop only for Unix why did you use SOCKET in some occasions and int in some others? The source code is inconsistent and it just happens to work on Unix because there SOCKET and int have the same size. And this is also a fact. But I believe we should stop here, I admit all the faults you want, but please let's use SOCKET everywhere Cheers, Maurizio -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 19:25 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 9:55 AM, Maurizio Martignano wrote: All of this depends on the week type system of C, were types with different names, supposed to be used for different needs are considered equivalent is their size is the same. If we had used Ada none of this would have had happened: types with different names are different no matter what their size is. If we were using Ada a file descriptor in Unix would still be described as an integer. I'm not saying that the Unix code you've uncovered is portable between Unix and Windows. I'm just pointing out that pipes are defined as an array of two integers in Unix, so that the code isn't wrong for Unix, as you originally claimed. I did so hoping it would increase your understanding, i.e. your claim that it appears to be a bug even in Unix is incorrect. If you want to make progress here, just accept that the code is perfectly good Unix code and then figure out how to make the code work for both Unix and Windows, instead of trying to argue incorrectly that the code's not correct for Unix. It's not portable, but it's correct for Unix. Thank you. Anyhow in the base code 95% of the times or even more sockets are declared as SOCKET sockets. Here and there they are declared as int. This is an inconsistency and it should be removed. I do beg the community to do this little change because it is in the benefit and interest of everybody. I'm sure that the community will accept a patch that declares the pipe in a way that makes both Unix and Windows happy if you'll provide one. Meanwhile, quit complaining because I pointed out that, in Unix, int pipefd[2] is the correct declaration for a pipe. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
We are in violent agreement... It was never my intention to raise the discussion to this level. I just observed the code. I may have used tones a bit too strong or too stressing... I never used bad words... I am going to provide a patch that will remove the inconsistencies I tried to explain... It will be very a very limited set of changes but it will make Aolserver more portable. Funny we are ready to fight and willing to kill each other on int trigger[2] versus SOCKET trigger[2] argument BTW: being called a dick is not very pleasant, and the only reason I do not react on this is that I'm interested in making Aolserver portable more than anything else. Thank you for your understanding and kind support. -Original Message- From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Don Baccus Sent: 04 August 2011 21:52 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples On Aug 4, 2011, at 11:26 AM, Maurizio Martignano wrote: If you wanted to develop only for Unix why did you use SOCKET in some occasions and int in some others? Damnit, that was never the point. You said that you thought that the code was incorrect for Unix, as well, a bug lurking that just hadn't caught anyone yet. That's flat out wrong. That declaration is standard Unix, and as I tried to point out previously, the mistake was probably made by someone who wasn't aware that it's not portable to all versions of Windows. End of story. That's all I said. All this other stuff you're ranting about is totally unrelated to my point. As Rusty said, you're being a dick. I don't bother trying to help dicks. So I'll no longer try to help you. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
Hi, I'm looking at the code now -- definitely needs to be SOCKET in nsd.h. The reason can be seen in ns_sockpair in fd/sock.c where the code for a socket pair is done. It's just a wrapper around Unix socketpair() but has a bunch of extra code to do the loopback-connect thing on Windows. The socks are passed by reference -- this code thinks it's 16 bytes (i.e., 2 8-byte long ints) but it's getting 2 4-bytes from the trigger in the driver code. It's could be overwriting some more of the driver structure -- not clear. Note that ns_pipe != ns_sockpair. An ns_pipe is used to create process pipelines with the lib-c code on Windows. On Windows, it can't be used a s trigger pipe. The fix should be just updating nsd.h with SOCKET. I'd do it but I don't have any of my dev environment setup -- something I was going to finally dig into in a few weeks. Anyone else with commit could handle the code update. Compiling and testing on 64-bit Windows would be more work and require the Visual Studio stuff -- the Express C++ stuff appears to only support 32-bit. BTW: The basic strategy for Windows was to make it look as much like Unix as possible, as lightly as possible. This is why you get some weirdness like the opendir/readdir/closedir emulation code stuffed in the Windows thread library (nsthread/winthread.c). There's also quite a bit of ifdef WIN stuff in the process exec code (nsd/exec.c) and some file management code (nsd/fd.c). The use of trigger pipes is a Unix way of monitoring events -- I think on Windows you could WaitForMultipleHandles with all sorts of things, including network and process sync stuff, but since the goal was to be Unix-like, instead of modifying the event-driven code to eliminate socketpair's for wakeup, this ns_sockpair emulation was used instead. Also, in later versions Windows was being ignored -- you see this in the oversight of SOCKET for the driver trigger we've been talking about and the NsMap code not yet implemented for Windows. I agree a scan of all SOCKETs not being declared are SOCKET's makes good sense. -Jim On Aug 4, 2011, at 8:28 AM, Maurizio Martignano wrote: It is not a matter of understanding It is a matter of testing On Windows 64 int trigger[2] doesn’t work whereas SOCKET trigger[2] does work. On top of that in several other places SOCKET has been used, so if for no other reason, I suggest one of the code maintainers takes a proper walk on the code base and make sure that all sockets are SOCKET sockets and not int sockets… Ciao, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 04 August 2011 15:51 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples It's probably safer to define this as SOCKET, but windows.h says SOCKET is: typedef u_int SOCKET; And: typedef unsigned intu_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver Progress - Some few examples....
I am doing the scan and I am preparing the patch. I will have also to do the testing as some of my customers do require the Windows 64 version. And I may offer to do this testing also in the future, non on a continuous basis, but every now and then. Ciao and thanks, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Jim Davidson Sent: 05 August 2011 00:43 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples Hi, I'm looking at the code now -- definitely needs to be SOCKET in nsd.h. The reason can be seen in ns_sockpair in fd/sock.c where the code for a socket pair is done. It's just a wrapper around Unix socketpair() but has a bunch of extra code to do the loopback-connect thing on Windows. The socks are passed by reference -- this code thinks it's 16 bytes (i.e., 2 8-byte long ints) but it's getting 2 4-bytes from the trigger in the driver code. It's could be overwriting some more of the driver structure -- not clear. Note that ns_pipe != ns_sockpair. An ns_pipe is used to create process pipelines with the lib-c code on Windows. On Windows, it can't be used a s trigger pipe. The fix should be just updating nsd.h with SOCKET. I'd do it but I don't have any of my dev environment setup -- something I was going to finally dig into in a few weeks. Anyone else with commit could handle the code update. Compiling and testing on 64-bit Windows would be more work and require the Visual Studio stuff -- the Express C++ stuff appears to only support 32-bit. BTW: The basic strategy for Windows was to make it look as much like Unix as possible, as lightly as possible. This is why you get some weirdness like the opendir/readdir/closedir emulation code stuffed in the Windows thread library (nsthread/winthread.c). There's also quite a bit of ifdef WIN stuff in the process exec code (nsd/exec.c) and some file management code (nsd/fd.c). The use of trigger pipes is a Unix way of monitoring events -- I think on Windows you could WaitForMultipleHandles with all sorts of things, including network and process sync stuff, but since the goal was to be Unix-like, instead of modifying the event-driven code to eliminate socketpair's for wakeup, this ns_sockpair emulation was used instead. Also, in later versions Windows was being ignored -- you see this in the oversight of SOCKET for the driver trigger we've been talking about and the NsMap code not yet implemented for Windows. I agree a scan of all SOCKETs not being declared are SOCKET's makes good sense. -Jim On Aug 4, 2011, at 8:28 AM, Maurizio Martignano wrote: It is not a matter of understanding It is a matter of testing On Windows 64 int trigger[2] doesnt work whereas SOCKET trigger[2] does work. On top of that in several other places SOCKET has been used, so if for no other reason, I suggest one of the code maintainers takes a proper walk on the code base and make sure that all sockets are SOCKET sockets and not int sockets Ciao, Maurizio From: AOLserver Discussion [mailto:AOLSERVER@LISTSERV.AOL.COM] On Behalf Of Dossy Shiobara Sent: 04 August 2011 15:51 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver Progress - Some few examples It's probably safer to define this as SOCKET, but windows.h says SOCKET is: typedef u_int SOCKET; And: typedef unsigned intu_int; Since Windows is LLP64 and most Unix-like systems are LP64, I don't understand how AOLserver's defining trigger[2] as (int) is the problem -- Windows might complain about some signed/unsigned thing at compile time, but in both cases, (int) is 32 bits. On 8/4/11 3:24 AM, Maurizio Martignano wrote: inttrigger[2]; /* Wakeup trigger pipe. */ ß Why is this an int when it was a SOCKET (any justification) -- Dossy Shiobara | He realized the fastest way to change do...@panoptic.com | is to laugh at your own folly -- then you http://panoptic.com/ | can let go and quickly move on. (p. 70) * WordPress * jQuery * MySQL * Security * Business Continuity * -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com
Re: [AOLSERVER] AOLserver, nginx, and port numbers
or you could do in nginx proxy_redirect http://shared.furfly.net:8082 http://shared.furfly.net; On 02/03/2011 11:20 AM, Janine Ohmer wrote: Thanks, that did the trick! It works in the nsopenssl section also. janine On Feb 2, 2011, at 7:08 PM, Jeff Rogers wrote: It doesn't seem to be documented, but you can set a 'location' parameter for nssock that will override this: ns_section ns/server/server1/module/nssock ns_param port 8082 ns_param location http://shared.furfly.net Cheers, -J Janine Ohmer wrote: My problem is the value returned by [ns_conn location], which is http://shared.furfly.net:8082. This is partially correct; I told the site it's hostname is shared.furfly.net and it seems to be ok with that. But I can't get away with telling it that it's running on port 80, and [ns_conn location] seems to be returning whatever's in the config file. What I want, of course, is just http://shared.furfly.net. Is there some way to set this up so it returns the desired value, even though from AOLserver's point of view that's not exactly correct? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email tolists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. --- Janine Ohmer (formerly Sisk) President/CEO of furfly, LLC 503-693-6407 -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email tolists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver, nginx, and port numbers
For virtual hosting I use this wrapper for ns_conn function: rename ns_conn _ns_conn proc ns_conn {args} { set host [string tolower [ns_set get [ns_conn headers] Host]] if {[string match [lindex $args 0] host]} { regexp {[^:]+} $host host return $host } elseif {[string match [lindex $args 0] server]} { regexp {[^:\.]+} $host host return $host } elseif {[string match [lindex $args 0] port]} { if { [regexp {:(\d+)} $host str port] == 1 } { return $port } return } elseif {[string match [lindex $args 0] protocol]} { if {[string equal [ns_set get [ns_conn headers] X-Forwarded-Proto] https]} { return https } return http } elseif {[string match [lindex $args 0] location]} { return [ns_conn protocol]://$host } else { return [_ns_conn {*}$args] } } Reverse-proxy (HAProxy,Pound,etc.) is adding headers X-Forwarded-Proto for https connections. 2011/2/3 Janine Ohmer jan...@furfly.net I'm moving some sites onto an Amazon EC2 instance, which has only one IP address, so I'm using nginx to make this work. The websites (both Apache and AOLserver) are running on various internal ports. The site I'm having trouble with is running on http://localhost:8082 internally, and on http://shared.furfly.net to everyone coming in through nginx. My problem is the value returned by [ns_conn location], which is http://shared.furfly.net:8082. This is partially correct; I told the site it's hostname is shared.furfly.net and it seems to be ok with that. But I can't get away with telling it that it's running on port 80, and [ns_conn location] seems to be returning whatever's in the config file. What I want, of course, is just http://shared.furfly.net. Is there some way to set this up so it returns the desired value, even though from AOLserver's point of view that's not exactly correct? thanks, janine --- Janine Ohmer (formerly Sisk) President/CEO of furfly, LLC 503-693-6407 -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver, nginx, and port numbers
It doesn't seem to be documented, but you can set a 'location' parameter for nssock that will override this: ns_section ns/server/server1/module/nssock ns_param port 8082 ns_param location http://shared.furfly.net Cheers, -J Janine Ohmer wrote: My problem is the value returned by [ns_conn location], which is http://shared.furfly.net:8082. This is partially correct; I told the site it's hostname is shared.furfly.net and it seems to be ok with that. But I can't get away with telling it that it's running on port 80, and [ns_conn location] seems to be returning whatever's in the config file. What I want, of course, is just http://shared.furfly.net. Is there some way to set this up so it returns the desired value, even though from AOLserver's point of view that's not exactly correct? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver, nginx, and port numbers
Thanks, that did the trick! It works in the nsopenssl section also. janine On Feb 2, 2011, at 7:08 PM, Jeff Rogers wrote: It doesn't seem to be documented, but you can set a 'location' parameter for nssock that will override this: ns_section ns/server/server1/module/nssock ns_param port 8082 ns_param location http://shared.furfly.net Cheers, -J Janine Ohmer wrote: My problem is the value returned by [ns_conn location], which is http://shared.furfly.net:8082. This is partially correct; I told the site it's hostname is shared.furfly.net and it seems to be ok with that. But I can't get away with telling it that it's running on port 80, and [ns_conn location] seems to be returning whatever's in the config file. What I want, of course, is just http://shared.furfly.net. Is there some way to set this up so it returns the desired value, even though from AOLserver's point of view that's not exactly correct? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. --- Janine Ohmer (formerly Sisk) President/CEO of furfly, LLC 503-693-6407 -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver and Oracle unable to allocate db handle
Maybe you already have a handle? If your adp already has a handle you can not get another, if you need 2 handles then do: set db [ns_db gethandle 2] set db1 [lindex $db 0] set db2 [lindex $db 1] Date: Thu, 20 Jan 2011 00:45:33 -0800 From: thejackschm...@gmail.com Subject: [AOLSERVER] AOLserver and Oracle unable to allocate db handle To: AOLSERVER@LISTSERV.AOL.COM Hi, I'm running on AOLserver 4.5.1 and everything for the most part seems fine. On occasion, I get this error message when the server tries to get a db handle: could not allocate 1 handle(s) from pool default From what I know, it should mean that AOLserver ran out of database pools to use. I tried upping the pools on the 'default' group but it didn't seem to help. I'm wondering if anyone can shed some light on the nature of this problem and possible things I should look into. Any help is appreciated. Thanks! -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
Dear Björn, While i don't see the direct connection between your changed settings and error with EAGAIN, there are apparently misconfiguration in the snippet of your config file which are related to the changed settings: 1) If you have maxthreads defined as 10, then your first db-pool should have at least 10 db-connections. Note, that you might have in your app as well scheduled procs that will use as well db-connections; 15 might be a good value. 2) In the pools parameter, you have to enlist you pools (pools * is not allowed for new aolservers, use in your example pool1,pool2,pool3 instead of the *). For an example of the config file, see: http://cvs.openacs.org/browse/OpenACS/openacs-4/etc/config.tcl?r=HEAD -gustaf neumann On 01.12.10 16:25, Björn Þór Jónsson wrote: Hi, The server has been rock stable since I changed ns_param maxconnections 5 to ns_param maxconnections 100 and from ns_param maxthreads 5 to ns_param maxthreads 10 ulimit -u says: unlimited and /etc/security/limits.conf has all lines commented out. Thanks for the help :) /Björn 2010/11/22 Gustaf Neumann neum...@wu.ac.at mailto:neum...@wu.ac.at Dear Björn, The error indicates that /pthread_create /returned EAGAIN (paraphrased as Resource temporarily unavailable). This error indicates that the system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process {PTHREAD_THREADS_MAX} would be exceeded. (from http://linux.die.net/man/3/pthread_create). so, for the user, under which the server runs, check ulimit -u, limits.conf, etc. Can it be that you switched to a new machine with lower limits than before? What is you setting of maxthreads? -gustaf neumann Am 18.11.10 17:13, schrieb Björn Þór Jónsson: Hi, After recently upgrading from AOLserver 4.5.0 to 4.5.1 and from nspostgres-4.0 to nspostgres-4.1 the server is repeatedly crashing (when it gets hammered by the google bots). The error.log has many entries like these before the server dies: [17/Nov/2010:02:18:42][700.3218660208][-default:6195-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:43][700.3217636208][-default:6193-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:44][700.3219172208][-default:6196-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:45][700.3218148208][-default:6194-] Error: Tcl exception: adp flush failed: connection closed abort exception raised while processing connection #31907: GET ... Host: localhost:8006 ... nsthreads: pthread_create failed in NsCreateThread: Resource temporarily unavailable [this is the last line in the log before the crash] This is the database section of the AOLserver config file: ns_section ns/db/drivers ns_param postgres nspostgres.so ns_section ns/db/pools ns_param pool1 Pool 1 ns_param pool2 Pool 2 ns_param pool3 Pool 3 ns_section ns/db/pool/pool1 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool2 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool3 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/server/${server}/db ns_param pools * ns_param defaultpoolpool1 The server is running on Ubuntu 10.04.1 LTS 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux Is there anything I should configure differently or has any other ideas what might be causing this? /Björn -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com mailto:lists...@listserv.aol.com with the
Re: [AOLSERVER] Aolserver at AOL...
Are there any AOLservers running in AOL any more? Brian From: AOLserver Discussion [aolser...@listserv.aol.com] On Behalf Of Dossy Shiobara [do...@panoptic.com] Sent: 01 December 2010 01:27 To: AOLSERVER@LISTSERV.AOL.COM Subject: Re: [AOLSERVER] Aolserver at AOL... new.aol.com isn't running AOLserver. You're relying on Netcraft, isn't exactly reliable or current. See: $ openssl s_client -connect new.aol.com:443 ... HEAD / HTTP/1.1 Host: new.aol.com:443 HTTP/1.1 302 Found Date: Wed, 01 Dec 2010 01:25:42 GMT Server: Apache Location: https://new.aol.com/freeaolweb Content-Type: text/html; charset=iso-8859-1 On 11/30/10 7:56 PM, Fernando Cassia wrote: I´m new to this list, but I´ve been following AOLServer developments since the Steve Case days and back when it was open sourced. I´ve noticed that AOL has been running AOLServer as its web server since time immemorial... and I guess there´s some AOL employees on this list. So I guess you´d be more than apt to tell me what is going on with AOL´s own misconfigured AOLservers making it impossible to sign up to aol´s free services for near two weeks?? http://www.techeye.net/internet/aol-refusing-new-accounts-thanks-to-fubar-server FC -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver at AOL...
On Tue, Nov 30, 2010 at 10:27 PM, Dossy Shiobara do...@panoptic.com wrote: new.aol.com isn't running AOLserver. You're relying on Netcraft, isn't exactly reliable or current. Thanks Dossy. Well, then it´s even more inexcusable for them to have the sign-up pages -which, by the way, serve not only AOL but also the AIM sign-up servers- down for to weeks without anybody noticing about it or acting to fix it. In fact, I went as far as e-mailing two of the firm´s top brass who should deal with the company´s IT infrastructure like the Senior Operations Architect at AOL, a Mr. Pollack. So far, no answer. Tragic, to say the least. My assumption was that they inadvertedly fired the last AOLserver sysadmin and now they were unable to find anyone to fix their misconfigured server. Now with your reply, it´s even more worrying, it seems they can´t find anyone capable of configuring an Apache server ;-) FC -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
Hi, The server has been rock stable since I changed ns_param maxconnections 5 to ns_param maxconnections 100 and from ns_param maxthreads 5 to ns_param maxthreads 10 ulimit -u says: unlimited and /etc/security/limits.conf has all lines commented out. Thanks for the help :) /Björn 2010/11/22 Gustaf Neumann neum...@wu.ac.at Dear Björn, The error indicates that *pthread_create *returned EAGAIN (paraphrased as Resource temporarily unavailable). This error indicates that the system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process {PTHREAD_THREADS_MAX} would be exceeded. (from http://linux.die.net/man/3/pthread_create). so, for the user, under which the server runs, check ulimit -u, limits.conf, etc. Can it be that you switched to a new machine with lower limits than before? What is you setting of maxthreads? -gustaf neumann Am 18.11.10 17:13, schrieb Björn Þór Jónsson: Hi, After recently upgrading from AOLserver 4.5.0 to 4.5.1 and from nspostgres-4.0 to nspostgres-4.1 the server is repeatedly crashing (when it gets hammered by the google bots). The error.log has many entries like these before the server dies: [17/Nov/2010:02:18:42][700.3218660208][-default:6195-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:43][700.3217636208][-default:6193-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:44][700.3219172208][-default:6196-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:45][700.3218148208][-default:6194-] Error: Tcl exception: adp flush failed: connection closed abort exception raised while processing connection #31907: GET ... Host: localhost:8006 ... nsthreads: pthread_create failed in NsCreateThread: Resource temporarily unavailable [this is the last line in the log before the crash] This is the database section of the AOLserver config file: ns_section ns/db/drivers ns_param postgres nspostgres.so ns_section ns/db/pools ns_param pool1 Pool 1 ns_param pool2 Pool 2 ns_param pool3 Pool 3 ns_section ns/db/pool/pool1 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool2 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool3 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/server/${server}/db ns_param pools * ns_param defaultpoolpool1 The server is running on Ubuntu 10.04.1 LTS 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux Is there anything I should configure differently or has any other ideas what might be causing this? /Björn -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- Univ.Prof. Dr. Gustaf Neumann Institute of Information Systems and New Media WU Vienna Augasse 2-6, A-1090 Vienna, AUSTRIA -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
Dear Björn, The error indicates that /pthread_create /returned EAGAIN (paraphrased as Resource temporarily unavailable). This error indicates that the system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process {PTHREAD_THREADS_MAX} would be exceeded. (from http://linux.die.net/man/3/pthread_create). so, for the user, under which the server runs, check ulimit -u, limits.conf, etc. Can it be that you switched to a new machine with lower limits than before? What is you setting of maxthreads? -gustaf neumann Am 18.11.10 17:13, schrieb Björn Þór Jónsson: Hi, After recently upgrading from AOLserver 4.5.0 to 4.5.1 and from nspostgres-4.0 to nspostgres-4.1 the server is repeatedly crashing (when it gets hammered by the google bots). The error.log has many entries like these before the server dies: [17/Nov/2010:02:18:42][700.3218660208][-default:6195-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:43][700.3217636208][-default:6193-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:44][700.3219172208][-default:6196-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:45][700.3218148208][-default:6194-] Error: Tcl exception: adp flush failed: connection closed abort exception raised while processing connection #31907: GET ... Host: localhost:8006 ... nsthreads: pthread_create failed in NsCreateThread: Resource temporarily unavailable [this is the last line in the log before the crash] This is the database section of the AOLserver config file: ns_section ns/db/drivers ns_param postgres nspostgres.so ns_section ns/db/pools ns_param pool1 Pool 1 ns_param pool2 Pool 2 ns_param pool3 Pool 3 ns_section ns/db/pool/pool1 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool2 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool3 ns_param maxidle10 ns_param maxopen10 ns_param connections5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/server/${server}/db ns_param pools * ns_param defaultpoolpool1 The server is running on Ubuntu 10.04.1 LTS 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux Is there anything I should configure differently or has any other ideas what might be causing this? /Björn -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- Univ.Prof. Dr. Gustaf Neumann Institute of Information Systems and New Media WU Vienna Augasse 2-6, A-1090 Vienna, AUSTRIA -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
Are there any good examples of proper connection threadpool configuration available? I've looked at http://openacs.org/forums/message-view?message_id=1146218 and am a bit confused. (BTW this is not an OpenACS site, just plain .adp pages). Thanks Alexey for the Ubuntu packages, before checking them out I'll try to get this latest AOLserver version just compiled to stay up :) /Björn 2010/11/18 Tom Jackson t...@rmadilo.com BTW, I don't think the issue you are seeing has anything to do with the database pools, the problem is the connection threadpools (you are using the default threadpool). tom jackson On Thu, Nov 18, 2010 at 8:42 AM, Alexey Pechnikov pechni...@mobigroup.ru wrote: On my debian lenny/squeeze 32 and 64 bit hosts this work fine with PostgreSQL 8.1/8.4: # Database drivers ns_section ns/db/drivers ns_param postgres nspostgres.so ;# An internal driver #ns_section ns/db/driver/postgres #ns_parampgbin /usr/lib/postgresql/8.1/bin/psql ns_section ns/db/pools ns_param maindb Main database Pool ns_param session Session database Pool ns_section ns/db/pool/maindb ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user$env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrorstrue ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open ns_section ns/db/pool/session ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user$env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrorstrue ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open # Accessing DB pools ns_section ns/server/${servername}/db ns_param pools *;# Wildcard gives access to all ns_param defaultpoolmaindb You can try on Ubuntu packages aolserver4 and aolserver4-nspostgres from my repository: deb http://mobigroup.ru/debian/ squeeze main non-free deb-src http://mobigroup.ru/debian/ squeeze main non-free -- Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
Here is one example: See the full configuration at: http://junom.com/document/aolserver/startup/errors.txt ns_section ns/server/junom/pool/default ns_param maxconnections 100 ns_param minthreads 4 ns_param maxthreads 10 ns_param threadtimeout 240 ns_param map {GET /} ns_param map {POST /} ns_section ns/server/junom/pool/fast ns_param maxconnections 100 ns_param minthreads 2 ns_param maxthreads 10 ns_param threadtimeout 120 ns_param map {GET /*-thumb.jpg} ns_section ns/server/junom/pools ns_param default {default pool} ns_param fast {fast pool} There is also a pools.tcl file which goes in the global tcl library directory (should be in the current AOLserver version). Right now, this only works only to configure the default pool. I have an updated pools.tcl file, but is also relies on a C patch which creates a separate namespace for each virtual server. Otherwise, any pool named default will overwrite the global pool, also named default. Here is what is in my pools.tcl file, which might give hints for using ns_pools: set cfgsection ns/server/[ns_info server] set minthreads [ns_config $cfgsection minthreads 0] set maxthreads [ns_config $cfgsection maxthreads 10] set maxconns [ns_config $cfgsection maxconnections 0] set timeout [ns_config $cfgsection threadtimeout 0] #ns_pools set default -minthreads $minthreads -maxthreads $maxthreads -maxconns $maxconns -timeout $timeout ns_log Notice Default Pool: [ns_pools get default] # Setup optional threadpools set poolSection $cfgsection/pools set poolSet [ns_configsection $poolSection] if {$poolSet ne } { set poolSize [ns_set size $poolSet] for {set i 0} {$i $poolSize} {incr i} { set poolName [ns_set key $poolSet $i] set poolDescription [ns_set value $poolSet $i] set poolConfigSection ns/server/[ns_info server]/pool/$poolName set poolConfigSet [ns_configsection $poolConfigSection] if {$poolConfigSet eq } { continue } set poolMinthreads [ns_config $poolConfigSection minthreads $minthreads] set poolMaxthreads [ns_config $poolConfigSection maxthreads $maxthreads] set poolMaxconns [ns_config $poolConfigSection maxconnections $maxconns] set poolTimeout[ns_config $poolConfigSection threadtimeout $timeout] ns_pools set $poolName -minthreads $poolMinthreads -maxthreads $poolMaxthreads -maxconns $poolMaxconns -timeout $poolTimeout ns_log Notice $poolName Pool: [ns_pools get [ns_info server]-$poolName] set poolConfigSize [ns_set size $poolConfigSet] for {set j 0} {$j $poolConfigSize} {incr j} { if {[string tolower [ns_set key $poolConfigSet $j]] eq map} { set mapList [split [ns_set value $poolConfigSet $j]] set poolMethod [lindex $mapList 0] set poolPattern [lindex $mapList 1] ns_pools register ${poolName} [ns_info server] $poolMethod $poolPattern ns_log Notice ns_pools registered $poolName [ns_info server] $poolMethod $poolPattern } } } } (You can use the ns_pools command anywhere, even after startup or from the control port) I think the above script can be fixed by modifying [ns_pools set] to this: ns_pools set [ns_info server]-$poolName -minthreads $poolMinthreads -maxthreads $poolMaxthreads -maxconns $poolMaxconns -timeout $poolTimeout (anywhere you see $poolName, replace with [ns_info server]-$poolName): ns_pools register [ns_info server]-${poolName} [ns_info server] $poolMethod $poolPattern tom jackson (you can post or send me directly the config info during startup if you have problems) 2010/11/19 Björn Þór Jónsson ban...@bthj.is: Are there any good examples of proper connection threadpool configuration available? I've looked at http://openacs.org/forums/message-view?message_id=1146218 and am a bit confused. (BTW this is not an OpenACS site, just plain .adp pages). Thanks Alexey for the Ubuntu packages, before checking them out I'll try to get this latest AOLserver version just compiled to stay up :) /Björn 2010/11/18 Tom Jackson t...@rmadilo.com BTW, I don't think the issue you are seeing has anything to do with the database pools, the problem is the connection threadpools (you are using the default threadpool). tom jackson On Thu, Nov 18, 2010 at 8:42 AM, Alexey Pechnikov pechni...@mobigroup.ru wrote: On my debian lenny/squeeze 32 and 64 bit hosts this work fine with PostgreSQL 8.1/8.4: # Database drivers ns_section ns/db/drivers ns_param postgres nspostgres.so ;# An internal driver #ns_section ns/db/driver/postgres #ns_param pgbin /usr/lib/postgresql/8.1/bin/psql ns_section ns/db/pools ns_param maindb Main database Pool ns_param session Session database Pool ns_section ns/db/pool/maindb ns_param driver
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
On my debian lenny/squeeze 32 and 64 bit hosts this work fine with PostgreSQL 8.1/8.4: # Database drivers ns_section ns/db/drivers ns_param postgres nspostgres.so ;# An internal driver #ns_section ns/db/driver/postgres #ns_parampgbin /usr/lib/postgresql/8.1/bin/psql ns_section ns/db/pools ns_param maindb Main database Pool ns_param session Session database Pool ns_section ns/db/pool/maindb ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user$env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrorstrue ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open ns_section ns/db/pool/session ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user$env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrorstrue ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open # Accessing DB pools ns_section ns/server/${servername}/db ns_param pools *;# Wildcard gives access to all ns_param defaultpoolmaindb You can try on Ubuntu packages aolserver4 and aolserver4-nspostgres from my repository: deb http://mobigroup.ru/debian/ squeeze main non-free deb-src http://mobigroup.ru/debian/ squeeze main non-free -- Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
My guess is that this is caused by the way the current threadpool code works. I'll have to see if I can find my test data, but here is what I remember off the top of my head. There are a few causes: 1. use of Ns_CondSignal instead of Ns_CondBroadcast to wakeup threadpool threads. This usually results in the thread which just sent the signal to wake up and grab the mutex again, and service another request. This results in the max number of requests per thread being reached for a particular thread and it tries to exit. 2. The exiting thread starts up a replacement thread under certain conditions. Sometimes, with many requests coming in, this new thread will grab the mutex repeatedly, and get into the same condition as #1. However, thread exiting from #1 hasn't yet exited and now its parent is also trying to exit. 3. The basic problem is detecting when to allow threads to exit. For instance, a thread might exit because it has been sitting around for too long. Say it has serviced 10 connections and is supposed to exit at 50. What has happened is that you remove the ability to handle 40 requests. The visible result of this is the inability of the server to maintain threads between the min and max specified for a particular threadpool. (Replacing a thread at thread exit patches over this problem, but causes a different problem). Note that it is hard to demonstrate the bug, I only found it by hammering the server. But the bug inevitably shows up and crashes the server. I also added additional logging code so I was able to track what thread was servicing requests and the configuration of the thread during each request (how many conns had been serviced, etc.). tom jackson 2010/11/18 Björn Þór Jónsson ban...@bthj.is: Hi, After recently upgrading from AOLserver 4.5.0 to 4.5.1 and from nspostgres-4.0 to nspostgres-4.1 the server is repeatedly crashing (when it gets hammered by the google bots). The error.log has many entries like these before the server dies: [17/Nov/2010:02:18:42][700.3218660208][-default:6195-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:43][700.3217636208][-default:6193-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:44][700.3219172208][-default:6196-] Notice: exiting: exceeded max connections per thread [17/Nov/2010:02:18:45][700.3218148208][-default:6194-] Error: Tcl exception: adp flush failed: connection closed abort exception raised while processing connection #31907: GET ... Host: localhost:8006 ... nsthreads: pthread_create failed in NsCreateThread: Resource temporarily unavailable [this is the last line in the log before the crash] This is the database section of the AOLserver config file: ns_section ns/db/drivers ns_param postgres nspostgres.so ns_section ns/db/pools ns_param pool1 Pool 1 ns_param pool2 Pool 2 ns_param pool3 Pool 3 ns_section ns/db/pool/pool1 ns_param maxidle 10 ns_param maxopen 10 ns_param connections 5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool2 ns_param maxidle 10 ns_param maxopen 10 ns_param connections 5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/db/pool/pool3 ns_param maxidle 10 ns_param maxopen 10 ns_param connections 5 ns_param extendedtableinfo true ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user $user_account ns_section ns/server/${server}/db ns_param pools * ns_param defaultpool pool1 The server is running on Ubuntu 10.04.1 LTS 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux Is there anything I should configure differently or has any other ideas what might be causing this? /Björn -- Björn Þór Jónsson http://bthj.is -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver 4.5.1 crashing with max connections per thread messages
BTW, I don't think the issue you are seeing has anything to do with the database pools, the problem is the connection threadpools (you are using the default threadpool). tom jackson On Thu, Nov 18, 2010 at 8:42 AM, Alexey Pechnikov pechni...@mobigroup.ru wrote: On my debian lenny/squeeze 32 and 64 bit hosts this work fine with PostgreSQL 8.1/8.4: # Database drivers ns_section ns/db/drivers ns_param postgres nspostgres.so ;# An internal driver #ns_section ns/db/driver/postgres #ns_param pgbin /usr/lib/postgresql/8.1/bin/psql ns_section ns/db/pools ns_param maindb Main database Pool ns_param session Session database Pool ns_section ns/db/pool/maindb ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user $env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrors true ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open ns_section ns/db/pool/session ns_param driver postgres ns_param datasource $env(PGHOST):$env(PGPORT):$env(PGDBNAME) ns_param user $env(PGUSER) ns_param password ns_param connections 20 ns_param logsqlerrors true ;# Verbose SQL query error logging ns_param verbose false ;# Verbose error logging ns_param maxidle 600 ;# Max time to keep idle db conn open ns_param maxopen 3600 ;# Max time to keep active db conn open # Accessing DB pools ns_section ns/server/${servername}/db ns_param pools * ;# Wildcard gives access to all ns_param defaultpool maindb You can try on Ubuntu packages aolserver4 and aolserver4-nspostgres from my repository: deb http://mobigroup.ru/debian/ squeeze main non-free deb-src http://mobigroup.ru/debian/ squeeze main non-free -- Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
After looking at the URI RFCs (twilight zone), here is a basic algorithm which should be applied to the request: 1: Unreserved chars should always be unescaped (if they are escaped), producing a normalized request uri (assuming no #3 illegal chars, this is what will go into the log file): unreserved = ALPHA / DIGIT / - / . / _ / ~ 2: reserved chars should be left as-is: reserved= gen-delims / sub-delims gen-delims = : / / / ? / # / [ / ] / @ sub-delims = ! / $ / / ' / ( / ) / * / + / , / ; / = 3: Any other char should be considered an exploit or client error. If the url is logged, it might end with the % encoded representation of the first illegal char, plus a response code to identify the client error. Since this decoding/normalization step should take place when processing the start-line/request-line, this might be a good time to update AOLserver to handle absolute uri, which will also require changes to the logic used for (virtual) host identification. The RFC support for this is from 3986: 2.1. Percent-Encoding A percent-encoding mechanism is used to represent a data octet in a component when that octet's corresponding character is outside the allowed set or is being used as a delimiter of, or within, the component. A percent-encoded octet is encoded as a character triplet, consisting of the percent character % followed by the two hexadecimal digits representing that octet's numeric value. For example, %20 is the percent-encoding for the binary octet 0010 (ABNF: %x20), which in US-ASCII corresponds to the space character (SP). Section 2.4 describes when percent-encoding and decoding is applied. pct-encoded = % HEXDIG HEXDIG The uppercase hexadecimal digits 'A' through 'F' are equivalent to the lowercase digits 'a' through 'f', respectively. If two URIs differ only in the case of hexadecimal digits used in percent-encoded octets, they are equivalent. For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent- encodings. Anyway, it is critical to examine and normalize the request uri asap and act quickly when presented with invalid chars. tom jackson On Sat, Sep 11, 2010 at 4:00 PM, Tom Jackson t...@rmadilo.com wrote: This is not an AOLserver issue to write a log file that is safe for broken programs. If there are illegal chars in the URL, maybe reject the request outright. If the chars are legal, then there isn't much else to be done. Chances are the chars in question should be escaped in the URL, so the request should be rejected. Although it might be nice to inform the client, it might be okay and more safe to just drop the request with no response. tom jackson On Fri, Sep 10, 2010 at 9:34 AM, Dossy Shiobara do...@panoptic.com wrote: Fair enough. ;-) On 9/10/10 2:07 AM, Gustaf Neumann wrote: The information loss (changing ESC to the bell character 7) is very little; under normal operation, you should never have a bell character in the log file, and now, if you see one, it should ring a bell -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
Actually, someone made the point -- what if you log request *headers* and someone puts a malicious byte sequence in that header? What's the rule around escaping the header values? What about every other code path where a remote user can write unfiltered bytes to a file on the server (logfile, etc.). Essentially, the vulnerability here isn't in applications that write these bytes to files, but specific terminal applications that are weak and should be fixed. Otherwise, cat is potentially vulnerable and that's a ridiculous position to hold. On 9/13/10 4:46 PM, Tom Jackson wrote: Anyway, it is critical to examine and normalize the request uri asap and act quickly when presented with invalid chars. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
IOW, fix the consumer (where the real bug is), not every producer. On 13/09/2010 2:16 PM, Dossy Shiobara wrote: Actually, someone made the point -- what if you log request *headers* and someone puts a malicious byte sequence in that header? What's the rule around escaping the header values? What about every other code path where a remote user can write unfiltered bytes to a file on the server (logfile, etc.). Essentially, the vulnerability here isn't in applications that write these bytes to files, but specific terminal applications that are weak and should be fixed. Otherwise, cat is potentially vulnerable and that's a ridiculous position to hold. On 9/13/10 4:46 PM, Tom Jackson wrote: Anyway, it is critical to examine and normalize the request uri asap and act quickly when presented with invalid chars. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
Dossy, I agree that the problem is not with AOLserver, wrt reading the log file, but AOLserver should probably not accept url bytes outside of the accepted range. Headers are slightly more difficult to handle. I have a test http client (htclient) which only accepts context appropriate bytes. For headers the range of acceptable bytes is larger, but you first have to identify the context. From what I can figure out right now, URLs can't contain unescaped control characters, so valid urls written to a log file will never cause problems with shell programs. On Mon, Sep 13, 2010 at 2:16 PM, Dossy Shiobara do...@panoptic.com wrote: Actually, someone made the point -- what if you log request *headers* and someone puts a malicious byte sequence in that header? What's the rule around escaping the header values? What about every other code path where a remote user can write unfiltered bytes to a file on the server (logfile, etc.). Essentially, the vulnerability here isn't in applications that write these bytes to files, but specific terminal applications that are weak and should be fixed. Otherwise, cat is potentially vulnerable and that's a ridiculous position to hold. This is absolutely correct. External applications should protect themselves against malicious input. Many do. Occasionally I make a mistake and read a binary file. The result is lots of beeps and strange graphical characters appearing on the terminal. The only solution is to exit the terminal. Headers are much more dangerous than the request-line, but the problem is with the reader, not the http application. The request line cannot contain malicious characters, I'll have to review the headers definition (either don't log headers or read them with a safe reader). tom jackson On 9/13/10 4:46 PM, Tom Jackson wrote: Anyway, it is critical to examine and normalize the request uri asap and act quickly when presented with invalid chars. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
This is not an AOLserver issue to write a log file that is safe for broken programs. If there are illegal chars in the URL, maybe reject the request outright. If the chars are legal, then there isn't much else to be done. Chances are the chars in question should be escaped in the URL, so the request should be rejected. Although it might be nice to inform the client, it might be okay and more safe to just drop the request with no response. tom jackson On Fri, Sep 10, 2010 at 9:34 AM, Dossy Shiobara do...@panoptic.com wrote: Fair enough. ;-) On 9/10/10 2:07 AM, Gustaf Neumann wrote: The information loss (changing ESC to the bell character 7) is very little; under normal operation, you should never have a bell character in the log file, and now, if you see one, it should ring a bell -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
as i said, a quick fix to close the logging exploit. The information loss (changing ESC to the bell character 7) is very little; under normal operation, you should never have a bell character in the log file, and now, if you see one, it should ring a bell the incoming url might be url-encoded or not. if one url-encodes the logged url, then there is as well an information loss. One could certainly just url-encode the escape character, but there is as well an information loss on these. One could grep safely for the bell character, but this is probably not very intuitive. Note, that it is not only sufficient to escape the url, the attack could as well come from other http reply header fields. One should implement a DStringAppendSanitized() function in nslog.c to allow multi-character substitutions. -gustaf On 09.09.10 14:41, Dossy Shiobara wrote: As a short-term solution, this is probably adequate, but there's information loss -- it'd be nice to indicate the original byte sequence somehow in the log entry by escaping characters so that log analysis tools could detect such attacks, etc. Perhaps the right answer is to log the URI with proper URL-encoding, so that it would be logged as %1B instead of the literal byte. On 9/9/10 8:18 AM, Gustaf Neumann wrote: i have just now committed a quick fix for the problem into the aolserver/nslog/nslog.c into the sourceforge module. please check, if this is in all cases sufficient. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
The problem is a very old one, known at least since the 1980ies. There are discussions, whether this qualifies as a security problem of some software writing to a logfile or as a problem of the terminal emulators (which it actually is). IMHO, this discussion is worthless. Some vendors of webservers even seem to refuse to fix this. Actually, every software writing unfiltered to some terminals is dangerous, even a grep. The real security problem are some terminal emulations, but there are many of these. The evil thing is that writing to the log file at the first place does nothing bad, but looking at the logfile with some standard tools can rise the problem - it is a sleeper attack. If the log file is e.g. accessible via NFS, the machines of developer developers watching the log file are under attack. As mentioned above this is not only a problem of aolserver, but potentially of more or less all logging programs or programs writing unfiltered to a terminal, such as e.g. database management systems, etc. If you're super-paranoid, don't tail -f access log files or other files that an attacker can write to through accessing a service on your system. Get into the habit of cat -v $FILENAME to make sure non-printable characters are escaped, intead of being fed unfiltered to your terminal program. or tail -f ... | cat -v -gustaf neumann -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
Fair enough. ;-) On 9/10/10 2:07 AM, Gustaf Neumann wrote: The information loss (changing ESC to the bell character 7) is very little; under normal operation, you should never have a bell character in the log file, and now, if you see one, it should ring a bell -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
As a short-term solution, this is probably adequate, but there's information loss -- it'd be nice to indicate the original byte sequence somehow in the log entry by escaping characters so that log analysis tools could detect such attacks, etc. Perhaps the right answer is to log the URI with proper URL-encoding, so that it would be logged as %1B instead of the literal byte. On 9/9/10 8:18 AM, Gustaf Neumann wrote: i have just now committed a quick fix for the problem into the aolserver/nslog/nslog.c into the sourceforge module. please check, if this is in all cases sufficient. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
Did I read this correctly: this is a remotely exploitable? Jade Jade Rubick | Director of Development | TRUiST 2201 Wisconsin Ave NW, Suite 250 | Washington, DC 20007 | www.truist.com | +1 202 903 2564 P Please consider the environment before printing The information contained in this email/document is confidential and may be legally privileged. Access to this email/document by anyone other than the intended recipient(s) is unauthorized. If you are not an intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance to it, is prohibited. On Sep 9, 2010, at 5:41 AM, Dossy Shiobara wrote: As a short-term solution, this is probably adequate, but there's information loss -- it'd be nice to indicate the original byte sequence somehow in the log entry by escaping characters so that log analysis tools could detect such attacks, etc. Perhaps the right answer is to log the URI with proper URL-encoding, so that it would be logged as %1B instead of the literal byte. On 9/9/10 8:18 AM, Gustaf Neumann wrote: i have just now committed a quick fix for the problem into the aolserver/nslog/nslog.c into the sourceforge module. please check, if this is in all cases sufficient. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
The exploit works like this: 1) Attacker sends HTTP request with ANSI escape sequence embedded in URL 2) Escape sequence is logged to access log. 3) Administrator on web server views log via cat, tail, etc.' 4) Escape sequences are interpreted by terminal emulator. In the case of extremely braindead terminal emulators, this can result in arbitrary command execution. The example in the SecurityFocus link sends an escape sequence which changes the window title in most common terminal emulators. A more comprehensive overview of terminal emulator security issues is available here: http://marc.info/?l=bugtraqm=104612710031920 Some subtle (?) points: 1) The remote exploit actually occurs on the host running the terminal emulator, not the web server. 2) Most terminal emulators do not support arbitrary command execution via escape sequences. -Andrew On Thu, Sep 9, 2010 at 9:47 AM, Jade Rubick jrub...@truist.com wrote: Did I read this correctly: this is a remotely exploitable? Jade * Jade Rubick *|* *Director of Development | *TRU**i**ST* 2201 Wisconsin Ave NW, Suite 250 | Washington, DC 20007 | *www.truist.com* | +1 202 903 2564 P Please consider the environment before printing The information contained in this email/document is confidential and may be legally privileged. Access to this email/document by anyone other than the intended recipient(s) is unauthorized. If you are not an intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance to it, is prohibited. On Sep 9, 2010, at 5:41 AM, Dossy Shiobara wrote: As a short-term solution, this is probably adequate, but there's information loss -- it'd be nice to indicate the original byte sequence somehow in the log entry by escaping characters so that log analysis tools could detect such attacks, etc. Perhaps the right answer is to log the URI with proper URL-encoding, so that it would be logged as %1B instead of the literal byte. On 9/9/10 8:18 AM, Gustaf Neumann wrote: i have just now committed a quick fix for the problem into the aolserver/nslog/nslog.c into the sourceforge module. please check, if this is in all cases sufficient. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer Terminal Escape Sequence in Logs Command Injection Vulnerability
tl;dr: Yes, this is remotely exploitable. Longer explanation: It is if and only if you use a terminal emulator that implements various exploitable escape sequences *and* cat/tail files that an attacker can write to, even indirectly, such as webserver access logs. For various attack vectors, read this: http://marc.info/?l=bugtraqm=104612710031920 If you're super-paranoid, don't tail -f access log files or other files that an attacker can write to through accessing a service on your system. Get into the habit of cat -v $FILENAME to make sure non-printable characters are escaped, intead of being fed unfiltered to your terminal program. On 9/9/10 10:47 AM, Jade Rubick wrote: Did I read this correctly: this is a remotely exploitable? -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
Hello! On Saturday 10 April 2010 08:49:57 you wrote: I think in general this is a good thing. In fact, I was just thinking about doing the same thing myself, except self-hosting with fossil instead of git. :) (no holy wars please) For me fossil will be more useful :-) And cvs-fossil convertor is exists. Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On Sat, Apr 10, 2010 at 4:28 PM, Dossy Shiobara do...@panoptic.com wrote: OK, lets consider that a +1 vote. I'll throw in my own +1 vote. Lets open the discussion for ~1 month - on May 15th, we'll do a final tally. Does anyone have any concerns? Reasons why this change shouldn't be made? An alternate change they'd like to propose and vote on? I signed up for an account under rmadilo, but I have no idea how to join/collaborate on the aolserver project. How does github work with more than one person? tom jackson Also, here is how I CVSimport AOLserver into git: #!/bin/bash CVSROOT=:pserver:anonym...@aolserver.cvs.sourceforge.net:/cvsroot/aolserver MODULE=aolserver REMOTE= export CVSROOT # -i import only # -v verbose git-cvsimport -v -i \ -d $CVSROOT \ -p x \ -C $MODULE \ $MODULE -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On 13/04/2010, at 9:58 AM, Tom Jackson wrote: On Sat, Apr 10, 2010 at 4:28 PM, Dossy Shiobara do...@panoptic.com wrote: OK, lets consider that a +1 vote. I'll throw in my own +1 vote. Lets open the discussion for ~1 month - on May 15th, we'll do a final tally. Does anyone have any concerns? Reasons why this change shouldn't be made? An alternate change they'd like to propose and vote on? I signed up for an account under rmadilo, but I have no idea how to join/collaborate on the aolserver project. How does github work with more than one person? go to http://github.com/aolserver/aolserver and click the fork button in the top-right-ish area. once you've got your own fork of the project (which should be visible at http://github.com/rmadilo/aolserver) and loaded a public key to github (under ssh public keys in your account settings) you can clone that to your local system with git clone g...@github.com:rmadilo/aolserver.git then cd into the new working copy and git remote add -f aolserver git://github.com/aolserver/aolserver.git which adds a new remote called aolserver pointing at the canonical repository and fetches (-f) everything from there. you can then git fetch aolserver or git pull aolserver to pull changes from the canonical repo and perhaps merge them, plus do whatever other local development you want in that working copy. push changes back to your master at github with git push and then send pull requests to dossy for hashes of commits that are in your public github repo. (there may be better ways of doing parts of this, I'm just starting to work with github myself...) cheers Russell -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
I'm perfectly fine with git, but I'm highly biased, given the fact that I've been using it for any AOLserver changes over a number of years. I would like to see the people who commit/maintain code agree, and that usually isn't me. I'm not very familiar with github however. When I compare it to gitweb, it kind of sucks. The searches don't include line number links. Maybe this can be configured. The interface looks more geared toward advertising than browsing code. This isn't critical for me I would likely pull in changes and use gitweb. I also don't see everything, I think the toplevel directory is missing, including aolserver.com and modules. Compare to this: http://junom.com/gitweb/gitweb.perl?p=aolserver.git;a=tree tom jackson On Sat, Apr 10, 2010 at 4:28 PM, Dossy Shiobara do...@panoptic.com wrote: OK, lets consider that a +1 vote. I'll throw in my own +1 vote. Lets open the discussion for ~1 month - on May 15th, we'll do a final tally. Does anyone have any concerns? Reasons why this change shouldn't be made? An alternate change they'd like to propose and vote on? On 4/10/10 9:35 AM, Jade Rubick wrote: Yes, let's officially move it to github. Awesome change! -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On 4/10/2010 12:19 AM, Dossy Shiobara wrote: As usual, feel free to flame me for running off into the weeds and just doing something without getting consensus or involving the community but I'm hoping at least a few of you will find this work worthwhile. If you have any positive comments and/or suggestions, don't hesitate to get in touch with me: I'd love to hear what you think. AOLserver's not dead, yet. ;-) I think this is an excellent idea. One complaint I have is that you're not committing to using git-hub -- you're not making it an official change. Frankly, sourceforge should probably go away as soon as possible (and CVS along with it). My personal preference would have been to host AOLserver on launchpad so I gently shake my fist at you for not involving the community. Still, I think this is overwhelmingly good news. -ayan -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
Over at http://junom.com/gitweb/gitweb.perl?p=aolserver.git I've sucked out all commits ever to CVS. Main use of this is the grep and pickax searches. Are these available on github? Oh, and the instant snapshot downloads (zip or tgz format). tom jackson BTW, what script do you use to keep the git repo up-to-date with CVS? On Fri, Apr 9, 2010 at 9:19 PM, Dossy Shiobara do...@panoptic.com wrote: Hi, So, I've finally gone crazy and have started pushing the contents of the CVS repository from SourceForge up to GitHub: http://aolserver.github.com/ http://github.com/aolserver I'm hoping this will make it easier for people to fork the code, make their own individual changes, and share those changes with the rest of the community. I'm hoping this will effectively eliminate any previous barriers to contibution - fork the code on github as much as you'd like in your own account, share your changes with whoever you please. Is this an official change? Of course not! The code still lives in CVS at SourceForge, like it always has - but now a copy with full CVS history is up at GitHub, as well. At this point, what does it mean to be official anyway, right? As of right now, I've only imported the aolserver module from CVS into GitHub. Over the next several weeks, I plan to import all the modules from CVS, but this takes time. A nice feature of GitHub is the included Issues system, their Wiki, and their static page hosting. If I get really ambitious, I might look to move as much of the AOLserver documentation as I can into the GitHub Pages area. As usual, feel free to flame me for running off into the weeds and just doing something without getting consensus or involving the community but I'm hoping at least a few of you will find this work worthwhile. If you have any positive comments and/or suggestions, don't hesitate to get in touch with me: I'd love to hear what you think. AOLserver's not dead, yet. ;-) -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On 4/10/10 2:11 PM, Tom Jackson wrote: Main use of this is the grep and pickax searches. Are these available on github? You can effectively grep/pickaxe using their web interface by doing a search on a single repository: http://github.com/search?q=repo:aolserver/aolserver+NS_ConnContent The Code Search returns results across all commits (i.e., pickaxe). It doesn't appear that you can specify a branch to isolate your search to - really, you'd want to just git clone the repo and do all your searching locally if using github. BTW, what script do you use to keep the git repo up-to-date with CVS? For this initial import I used cvs2git but I'll keep it up to date using git cvsimport, as necessary. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On 4/10/10 8:12 AM, ayan george wrote: My personal preference would have been to host AOLserver on launchpad so I gently shake my fist at you for not involving the community. https://launchpad.net/aolserver I think I submitted a VCS import request a LONG time ago, but nobody at LP could get the CVS repo imported and I didn't really follow up on it. I like Launchpad but after having dealt with Bazaar when contributing to the Gnash project, I wasn't really impressed by it (bzr, that is). If LP offered git repo hosting, that would make it more attractive. I see you created lp:anansi, how is that working out for you? -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
Yes, let's officially move it to github. Awesome change! J Jade Rubick | Director of Development | TRUiST 2201 Wisconsin Ave NW, Suite 250 | Washington, DC 20007 | www.truist.com | +1 202 903 2564 Please consider the environment before printing The information contained in this email/document is confidential and may be legally privileged. Access to this email/document by anyone other than the intended recipient(s) is unauthorized. If you are not an intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance to it, is prohibited. On Sat, Apr 10, 2010 at 5:12 AM, ayan george a...@ayan.net wrote: On 4/10/2010 12:19 AM, Dossy Shiobara wrote: As usual, feel free to flame me for running off into the weeds and just doing something without getting consensus or involving the community but I'm hoping at least a few of you will find this work worthwhile. If you have any positive comments and/or suggestions, don't hesitate to get in touch with me: I'd love to hear what you think. AOLserver's not dead, yet. ;-) I think this is an excellent idea. One complaint I have is that you're not committing to using git-hub -- you're not making it an official change. Frankly, sourceforge should probably go away as soon as possible (and CVS along with it). My personal preference would have been to host AOLserver on launchpad so I gently shake my fist at you for not involving the community. Still, I think this is overwhelmingly good news. -ayan -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
OK, lets consider that a +1 vote. I'll throw in my own +1 vote. Lets open the discussion for ~1 month - on May 15th, we'll do a final tally. Does anyone have any concerns? Reasons why this change shouldn't be made? An alternate change they'd like to propose and vote on? On 4/10/10 9:35 AM, Jade Rubick wrote: Yes, let's officially move it to github. Awesome change! -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
On 4/10/2010 4:01 PM, Dossy Shiobara wrote: I see you created lp:anansi, how is that working out for you? The project itself: Eh, I didn't intend to mention it to anyone unless I made any progress. Frankly, I'd prefer the official AOLserver branch to be more active. Either way, I haven't pushed any change sets to the project yet. It started with a few maybe naïve ideas: One of the things I would like to try is to delay chroot()ing until after much of the runtime linking is done. This way, I can keep shared libraries (like libpq.so) outside of my chroot() jail. While looking into how to configure this, I considered that maybe much of the ns_section and ns_param stuff could be replaced with a dictionary (of dictionaries) outside of the global namespace. I would also like use kqueue() for socket multiplexing. Really, it'd be nice to support all of the sexier edge triggered event notification routines. Right now, I'm trying to determine if any of those things are possible and worth while. Hosting on Launchpad: I don't have much experience with github but I do like launchpad's blueprints feature and I don't think github has an equivalent (other than maybe wikipages). When it comes to which VCS to use, I use git at work and bzr for personal things and I think both are light years ahead of CVS. I don't think we could go wrong by using either github or launchpad. -ayan -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
Dossy Shiobara wrote: Hi, So, I've finally gone crazy and have started pushing the contents of the CVS repository from SourceForge up to GitHub: http://aolserver.github.com/ http://github.com/aolserver I think in general this is a good thing. In fact, I was just thinking about doing the same thing myself, except self-hosting with fossil instead of git. :) (no holy wars please) While you're making updates, some of the links on www.aolserver.com are bad - the 'Tcl API' link ends up point to dev.aolserver.com which is apparently dead; some other stuff is flaky or slow (the panoptic.com wiki with the good docs often seems sluggish). If you could fix up a few of these broken-ish links, that'd be nice. Cheers, -J I'm hoping this will make it easier for people to fork the code, make their own individual changes, and share those changes with the rest of the community. I'm hoping this will effectively eliminate any previous barriers to contibution - fork the code on github as much as you'd like in your own account, share your changes with whoever you please. Is this an official change? Of course not! The code still lives in CVS at SourceForge, like it always has - but now a copy with full CVS history is up at GitHub, as well. At this point, what does it mean to be official anyway, right? As of right now, I've only imported the aolserver module from CVS into GitHub. Over the next several weeks, I plan to import all the modules from CVS, but this takes time. A nice feature of GitHub is the included Issues system, their Wiki, and their static page hosting. If I get really ambitious, I might look to move as much of the AOLserver documentation as I can into the GitHub Pages area. As usual, feel free to flame me for running off into the weeds and just doing something without getting consensus or involving the community but I'm hoping at least a few of you will find this work worthwhile. If you have any positive comments and/or suggestions, don't hesitate to get in touch with me: I'd love to hear what you think. AOLserver's not dead, yet. ;-) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver on GitHub
Dossy Shiobara wrote: Hi, So, I've finally gone crazy If you have any positive comments and/or suggestions, don't hesitate to get in touch with me: I'd love to hear what you think. AOLserver's not dead, yet. ;-) Also while you're at it, is the chat logger still running? And would anyone else be interested in moving the official aolserver chat from irc to a more modern and functional jabber server (perhaps with a bridge, like the tcler's chat has)? -J -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] aolserver on port 80
Hi Iuri, ¿Are you using the -b flag in the daemontools script? It's needed to use priviliged ports (1024). You should have something like this: exec /usr/local/aolserver/bin/nsd -it /usr/local/aolserver/servers/openacs/etc/config.tcl -u openacs -g web -b 192.168.1.15:80 Hope it helps. Héctor. El sáb, 31-10-2009 a las 17:58 -0300, iuri de araujo sampaio escribió: Hi there, I am using aolserver and openacs on my home server. In order to set up aolserver service on port 80 using daemontools, i did the following procedure: I opened the file openacs/etc/config.tcl and properly set to port 80, then i restart the machine and I got the expected error. [31/Oct/2009:10:48:38][2975.3083900608][-main-] Notice: nsmain: AOLserver/4.5.1 running [31/Oct/2009:10:48:38][2975.3083900608][-main-] Notice: nsmain: security info: uid=1001, euid=1001, gid=104, egid=104 [31/Oct/2009:10:48:38][2975.3074726832][-sched-] Notice: sched: starting [31/Oct/2009:10:48:38][2975.3083900608][-main-] Notice: driver: starting: nssock [31/Oct/2009:10:48:38][2975.2997271472][-nssock:driver-] Notice: starting [31/Oct/2009:10:48:38][2975.2997271472][-nssock:driver-] Error: nssock: failed to listen on 192.168.1.15:80: Permission denied [31/Oct/2009:10:48:38][2975.3083900608][-main-] Fatal: could not start drivers because port 80 is not a user-land port. i will have to start the aolserver instance as root, while making sure that nothing else is listening on that port. That means to make daemontools start aolserver as root user Then, i shut down daemontools svc -d /service/openacs and I ran the command as root user: svgroup root /service/* I restarted the machine again. But it didn't work, daemontools still starts aolserver as openacs user. I realized that some services of daemontools already run as root user and somehow it changes to openacs to start aolserver root 2315 1 0 10:32 ? 00:00:00 /bin/sh /command/svscanboot root 2321 2315 0 10:32 ? 00:00:00 svscan /service root 2322 2315 0 10:32 ? 00:00:00 readproctitle service errors: ...ng threadsafe tcl: 1?[31/Oct/2009:10:56:06][3263.3083060928][-main-] Notice: root 2323 2321 0 10:32 ? 00:00:00 supervise root root 2947 2232 0 10:47 ? 00:00:00 sshd: openacs [priv] openacs 2963 2947 0 10:48 ? 00:00:00 sshd: open...@pts/0 openacs 2964 2963 0 10:48 pts/0 00:00:00 -sh openacs 3277 2323 34 10:56 ? 00:00:02 /usr/local/aolserver/bin/nsd -it /usr/local/aolserver/servers/openacs/etc/config.tcl -u openacs -g web Furthermore, if i shut down daemontools svc -d /service/openacs I can start aolserver manually as root user using the command: /usr/local/aolserver/bin/nsd-postgres -it /usr/local/aolserver/servers/openacs/etc/config.tcl -u openacs -g web and everything works fine on port 80 I went back to the installation procedure of daemontools to verify where in daemontools i set openacs as the user to exec aolserver. But i have not found anything related. That's how i compiled and install daemontools: # Install Daemontools mkdir -p /package chmod 755 /package cd /package wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch tar -xvfz daemontools-0.76.tar.gz cd admin/daemontools-0.76 patch -Np1 -i ../../daemontools-0.76.errno.patch package/install cvs -d:pserver:anonym...@cvs.openacs.org mailto:anonym...@cvs.openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/svgroup.txt mv openacs-4/packages/acs-core-docs/www/files/svgroup.txt /usr/sbin/svgroup chmod 700 /usr/sbin/svgroup How do i make daemontools to run the script under openacs/etc/daemontools/run as root user? regards, iuri -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver templating options
Hossein Sharifi wrote: Hey all, What's the current state of templating systems in AOLserver? I've found two: 1) ATS: Is it well-maintained, and can it be easily used outside of an OpenACS installation? 2) http://junom.com/document/twt/view/www/ - it seems to be actively maintained given the fact that there are files in that directory created last month, but is it easy to install? And has it been tested in a production environment? 3) Are there any others? ADP Master Pages is worth checking out: http://aolserver.am.net/code/modules/masterpages.adpx -J -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver templating options
Hossein Sharifi wrote: Hey all, What's the current state of templating systems in AOLserver? I've found two: 1) ATS: Is it well-maintained, and can it be easily used outside of an OpenACS installation? It was originally developed to be used with a standalone CMS built by ars digita people in the bay area, and later adapted to work with aD's ACS (which evolved into OpenACS). Breaking it out to run standalone again shouldn't be that difficult. There are hook into our localization (message catalog) stuff but that could be ignored/ripped out. The ATS supports master templates that appear to be much like the ADP Master Pages mentioned by Jeff (so i guess the similar MS technology referenced by that site), and has done so since oh 1998, 1999. Actually it's a hierarchy of master templates with the top of the hierarchy being the master for the entire site. Don Baccus http://donb.photo.net http://birdnotes.net http://openacs.org -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLserver templating options
On Mon, Oct 26, 2009 at 3:53 PM, Hossein Sharifi shar...@rateyourmusic.com wrote: 2) http://junom.com/document/twt/view/www/ - it seems to be actively maintained given the fact that there are files in that directory created last month, but is it easy to install? And has it been tested in a production environment? I'm the maintainer. The current home for this is the tnt project: http://www.junom.com/gitweb/gitweb.perl?p=tnt.git It is still the view package, but requires, at least, the tnt package for logging. If you need help installing, please take advantage and ask here or via direct email. Any helpful hits will be shared as better documentation. The templating system is called tic-tac-toe, somewhat shorter than A templating toolkit for tcl. Although the files you saw have been updated recently, the actual code hasn't changed. It is relatively stable and the extension mechanism is well defined, so only actual bugs demand attention. But the templating system is somewhat conservative. You have to add resources in order to access anything outside of a particular template (the setup tcl file adds the resources). The whole point was a safe system where templates of unknown intent could safely be used. So, by default, template cannot execute unsafe commands, but resources can execute arbitrary code. The Tic-Tac-Toe example ( http://junom.com/document/twt/view/www/tic-tac-toe.tcl ) is non-trivial and demonstrates many of the features. The tnt toolkit has hundreds of examples of template files and a few examples of how to organize a website wide templating system. The readme file explains the language basics: http://junom.com/document/twt/view/www/README The template compiler is written in flex/bison so it it fast, but it also validates syntax. When an error occurs, you get a temporary file which ends close to the error. It is usually easy to find and fix syntax errors. The compiled template is just tcl code, once compiled, the compiled version remains valid until the original template file gets a newer timestamp. (You can use touch to force a recompile). 3) Are there any others? Good question. tom jackson -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On 16/10/2009, at 3:21 PM, nitin chandra wrote: On Thu, Oct 15, 2009 at 2:01 PM, nitin chandra nitinchand...@gmail.com wrote: following steps were taken for installation: # tar zxvf aolserver-4.5.1-src.tar.gz # cd aolserver-4.5.1 # ./configure --prefix=/opt/aolserver --with-tcl=/usr/lib\ --enable- threads | tee aol451_config.log ==== script files util/nsmakeall.tcl, util/nsinstall.tcl, util/nsremove.tcl, first, are not given appropriate permissions for execution (x) and, second, they are neither handed over to tclsh by make nor come with a shebang. 1 chmod u+x on all of the scripts mentioned above. 2 add shebangs (e.g., #!/usr/bin/tclsh) on the top of the scripts. =XXX== According to the README (section 3c) the correct way to build aolserver 4.5.1 is not calling configure yourself, but in the top level of the unpacked tarball to run tclsh nsconfig.tcl -install / path/to/wherever which itself runs configure and drives the rest of the process. First time I tried to build 4.5.1, I ran configure myself and later was unable to successfully complete the build (I don't recall the specific error), but running nsconfig.tcl instead did work. I never bothered looking inside to see what it's setting up differently, but there's obviously something. It looks like the specific problem you're having is the build system can't find or isn't trying to link against libpthread. Try the documented build process and see if that helps with setting up a working build environment. cheers Russell -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On 10/16/09 12:21 AM, nitin chandra wrote: On Thu, Oct 15, 2009 at 2:01 PM, nitin chandra nitinchand...@gmail.com wrote: Hello Everyone, I have a fresh installation of FC10, with gcc 4.3.2, kerrnel 2.6.27, on a P4 1.8GHz, 256 DDR RAM, with Python 2.6.2 (--enable-shared, --with-threads, /opt/python262), Tcl / Tk 8.5 installed as part of the distro (/usr/lib), tclConfig.sh has TCL_THREADS=1 Did you compile Tcl with --enable-threads, or did you just edit tclConfig.sh and set TCL_THREADS=1? It appears that you need -lpthreads but it's not being included in your LIBS and linker step. There's something strange going on ... do you have libpthreads installed? -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
Tcl was a default install ... as and when installed the OS. So i am not sure if it was installed with '--enable-threads'. I cant recollect editing TCL_THREADS=1 How do i find if 'libpthreads' is installed? Nitin I have a fresh installation of FC10, with gcc 4.3.2, kerrnel 2.6.27, on a P4 1.8GHz, 256 DDR RAM, with Python 2.6.2 (--enable-shared, --with-threads, /opt/python262), Tcl / Tk 8.5 installed as part of the distro (/usr/lib), tclConfig.sh has TCL_THREADS=1 Did you compile Tcl with --enable-threads, or did you just edit tclConfig.sh and set TCL_THREADS=1? It appears that you need -lpthreads but it's not being included in your LIBS and linker step. There's something strange going on ... do you have libpthreads installed? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On 10/16/09 12:15 PM, nitin chandra wrote: How do i find if 'libpthreads' is installed? You said you're on Fedora FC10, right? I'm guessing something like this: $ rpm -qa | grep pthreads might work. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
yum install did not work [r...@mi aolserver-4.5.1]# yum install pthreads Loaded plugins: refresh-packagekit fedora | 2.8 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.6 MB 01:26 Setting up Install Process Parsing package install arguments No package pthreads available. Nothing to do [r...@mi aolserver-4.5.1]# Reg Nitin -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
pth is what is loaded instead of pthreads ... on FC10. How do i integrate that. Reg Nitin On Fri, Oct 16, 2009 at 11:02 PM, nitin chandra nitinchand...@gmail.com wrote: [r...@mi aolserver-4.5.1]# rpm -qa | grep glibc glibc-devel-2.9-2.i386 glibc-common-2.9-2.i386 glibc-headers-2.9-2.i386 glibc-2.9-2.i686 [r...@mi aolserver-4.5.1]# Reg Nitin On Fri, Oct 16, 2009 at 10:39 PM, Dossy Shiobara do...@panoptic.com wrote: Sorry, it appears that pthreads should be part of glibc and glibc-devel. Check for those. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On 10/16/09 1:40 PM, nitin chandra wrote: just did # yum install pth-devel and it installed pth-devel now what ? I imagine you should make clean and then re-configure and re-make AOLserver. -- Dossy Shiobara | do...@panoptic.com | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on. (p. 70) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
ok here is what i found out ... after tinkering around ... and seeing some where on the web a post of 'pthread.c' ... which is also in aolserver-4.5.1/nsthread/ pthread.c has #include thread.h ;;; is there in nsthread/ #include pthread.h ;;; is not there in nsthread/, if its calling from OS then i ;;; stand corrected. tclsh nsconfig.tcl -install /path/to/wherever Ran this command .. finishes without any error and creating include/ns.mak [aolserver-4.5.1]# tclsh nsconfig.tcl -install /opt/aolserver451 I can build Tcl / Tk ... but then i have installed python 2.6.2 from source... with preinstlled tcl8.5 / tk8.5 which is a part of FFTW3, LAPACK-LITE, ATLAS, NumPy SciPy If i install ... or are left with no other option then i reinstall all the above which incidently took me approx 2months...and lot of sleepless nights ..will take less time now as i have documented all the steps still How do i know which tclsh is correct? so that leaves trying out TCLSH= . How do i set TCLSH? and should i give commands like # TCLSH=./configure --prefix=/opt/aolserver451 --with-tcl=/usr/lib --enable-threads | tee\ aol451_config.log and then # TCLSH=make | tee aol451_make.log #TCLSH=make install | tee aol451_install.log Reg Nitin -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On Fri, Oct 16, 2009 at 01:09:55PM -0400, Dossy Shiobara wrote: Sorry, it appears that pthreads should be part of glibc and glibc-devel. Check for those. What? Any vaguely normal Linux system is certainly going to have POSIX threads support, so looking at that stuff is a waste of time. What the original poster needs is: 1. A Tcl correctly configured and built using --enable-threads. He absolutely definitely needs this. 2. Optionally, the Tcl Thread Extension, for the enhanced AOLserver-compatible tsv support, etc. This stuff: http://tcl.cvs.sourceforge.net/viewvc/tcl/thread/doc/html/ http://tcl.cvs.sourceforge.net/viewvc/*checkout*/tcl/thread/doc/html/tsv.html?revision=1.16 On Ubuntu the Thread Extension is the tclthread package. Your distribution might have #1 available as a pre-built binary package, or it might not. If not, you need to compile Tcl yourself, either from source in the normal cross-platform Tcl manner, or by rebuilding your distribution's source package with different options. Recent versions of Ubuntu build Tcl with thread support, but historically, most Linux and Unix systems built Tcl single-threaded. -- Andrew Piskorski a...@piskorski.com http://www.piskorski.com/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
On 16/10/2009 11:45 AM, Andrew Piskorski wrote: On Fri, Oct 16, 2009 at 01:09:55PM -0400, Dossy Shiobara wrote: Sorry, it appears that pthreads should be part of glibc and glibc-devel. Check for those. What? Any vaguely normal Linux system is certainly going to have POSIX threads support, so looking at that stuff is a waste of time. What the original poster needs is: 1. A Tcl correctly configured and built using --enable-threads. He absolutely definitely needs this. 2. Optionally, the Tcl Thread Extension, for the enhanced AOLserver-compatible tsv support, etc. This stuff: http://tcl.cvs.sourceforge.net/viewvc/tcl/thread/doc/html/ http://tcl.cvs.sourceforge.net/viewvc/*checkout*/tcl/thread/doc/html/tsv.html?revision=1.16 On Ubuntu the Thread Extension is the tclthread package. Your distribution might have #1 available as a pre-built binary package, or it might not. If not, you need to compile Tcl yourself, either from source in the normal cross-platform Tcl manner, or by rebuilding your distribution's source package with different options. Recent versions of Ubuntu build Tcl with thread support, but historically, most Linux and Unix systems built Tcl single-threaded. Or download ActiveTcl 8.5, which is built with --enable-threads across all platforms and comes with the Thread extension: http://www.activestate.com/tcl Jeff -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AoLserver 4.5.1 install issue
How do i know which tclsh is correct? Fedora's TCL rpm is not thread enabled. It used to be but they switched it back a few releases ago. ./configure --enable-threads --enable-shared --prefix=/opt/tcl On the aolserver side, ./configure --with-tcl=/opt/tcl --prefix=/opt/aolserver Daniel -- | --- | Daniel P. Stasinski | http://www.saidsimple.com | dan...@avenues.org | http://www.disabilities-r-us.com | XMMP: m...@avenues.org | http://www.avenues.org | Google Talk: mooo| http://www.scriptkitties.com -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver as multithreaded TCL soc ket server ?
I thought I sent this last week, but I used the wrong account, anyway: This example is not multi-threaded, but it handles multiple connections. The basic API are ns_socklisten, ns_sockaccept and ns_sockcheck. (http://rmadilo.com/files/nsapi/) The example also uses ns_socklistencallback, but the code is very cryptic. Basically the client contacts the server with a contact address/port then creates a server to listen for updates (server push). The server uses ns_socklistencallback but avoids hanging in a single thread because it just gets the contact information and starts a scheduled proc to handle the recurring request (push). The scheduled proc contacts the client on the given schedule and pushes the requested data. The client could actually handle requests from multiple servers by using ns_socklisten/accept: http://www.junom.com/gitweb/gitweb.perl?p=3Dtwt.git;a=3Dtree;f=3Dpackages/tclbean/tcl;h=3D8f0100 tom jackson On Tue, Aug 18, 2009 at 5:56 AM, Nikolay Shulganikolay.shu...@runway.lv w= rote: Hello, Is it possible to use Aolserver as multithreaded TCL socket server ? If I connect to Aolserver using telnet , the server waits one of HTTP comands from me. But it would be good to have full access to the socket , from TCL script, without being obliged to send HTTP GET or other requests= . ns_register_proc - unfortunately doesn't give such a possibility, I can h= ave access to the socket but only after HTTP request has been sent. ns_socklistencallback - it gives full controll over the channell , but process only one client at the moment. It will accept connections from several clients, but will process only the first one. The others will blo= ck untill the first one will disconnect. Please , if anyone knows the solution for this, share it with me . -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver as multithreaded TCL soc ket server ?
The code should work ok. I remember it was a bit messy to map these Aolserver tcl commands which pre-dated the Tcl channel stuff so it was compatible years ago and there were examples of memory leaks from long running detached tcl threads but with care it should be ok Jim Sent from my iPhone On Aug 20, 2009, at 4:47 AM, Nikolay Shulga nikolay.shu...@runway.lv wrote: Hello, AolServer gives a possibility to use ns_socklistencallback to open a socket, 'ns_thread begindetached' to create thread, ns_chan - to path channel to this thread. If we do this with every new connection, we get multithreaded tcp socket server - which is exactly what I wanted. I've tested it and it works. Now I have a question if there exists any potential problem with such aproach ? During this week, I has been googling on this topic. I've met several discussions in the Internet on this theme, and for some strange reason nobody has proposed this method to be used, it has not been discussed. So is there a reason not to use it ? Nikolay Shulga Bas Scheffers wrote: As far as I am aware, the only way to do it is to implement a new socket driver in C. AOLserver can certainly handle this. There used to be nsftp, which did just that. Bas. On Tuesday, August 18, 2009 10:26pm, Nikolay Shulga nikolay.shu...@runway.lv said: Hello, Is it possible to use Aolserver as multithreaded TCL socket server ? If I connect to Aolserver using telnet , the server waits one of HTTP comands from me. But it would be good to have full access to the socket , from TCL script, without being obliged to send HTTP GET or other requests. ns_register_proc - unfortunately doesn't give such a possibility, I can have access to the socket but only after HTTP request has been sent. ns_socklistencallback - it gives full controll over the channell , but process only one client at the moment. It will accept connections from several clients, but will process only the first one. The others will block untill the first one will disconnect. Please , if anyone knows the solution for this, share it with me . -- Nikolay Shulga Nikolay Shulga IT Support Runway International Basteja blvd.16, Riga, LV 1050, Latvia Fax: +371 67 224 439 Mob. : +371 29 666 501 [mailto:nikolay.shu...@runway.lv] nikolay.shu...@runway.lv [http://www.runway.lv/] www.runway.lv __ Multi-lingual contact centre services for the Nordic, European, Russian and English speaking markets -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] Aolserver as multithreaded TCL soc ket server ?
Hello, AolServer gives a possibility to use ns_socklistencallback to open a socket, 'ns_thread begindetached' to create thread, ns_chan - to path channel to this thread. If we do this with every new connection, we get multithreaded tcp socket server - which is exactly what I wanted. I've tested it and it works. Now I have a question if there exists any potential problem with such aproach ? During this week, I has been googling on this topic. I've met several discussions in the Internet on this theme, and for some strange reason nobody has proposed this method to be used, it has not been discussed. So is there a reason not to use it ? Nikolay Shulga Nikolay Shulga Bas Scheffers wrote: As far as I am aware, the only way to do it is to implement a new socket driver in C. AOLserver can certainly handle this. There used to be nsftp, which did just that. Bas. On Tuesday, August 18, 2009 10:26pm, "Nikolay Shulga" nikolay.shu...@runway.lv said: Hello, Is it possible to use Aolserver as multithreaded TCL socket server ? If I connect to Aolserver using telnet , the server waits one of HTTP comands from me. But it would be good to have full access to the socket , from TCL script, without being obliged to send HTTP GET or other requests. ns_register_proc - unfortunately doesn't give such a possibility, I can have access to the socket but only after HTTP request has been sent. ns_socklistencallback - it gives full controll over the channell , but process only one client at the moment. It will accept connections from several clients, but will process only the first one. The others will block untill the first one will disconnect. Please , if anyone knows the solution for this, share it with me . -- Nikolay Shulga Nikolay Shulga IT Support Runway International Basteja blvd.16, Riga, LV 1050, Latvia Fax: +371 67 224 439 Mob. : +371 29 666 501 [mailto:nikolay.shu...@runway.lv] nikolay.shu...@runway.lv [http://www.runway.lv/] www.runway.lv __ Multi-lingual contact centre services for the Nordic, European, Russian and English speaking markets -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer 4.x blindly reporting X-Forwarded-For value in logs
There is no built-in setting to log or not log forwarded headers. It's not difficult to change, but it requires a little programming. If you are comfortable with C, you can edit nslog/nslog.c and change the behaviour with X-Forwarded-For (it's at nslog.c:272 in my copy). You could disable the check and always log the real ip, log both the real and forwarded header, or make it dependent on a config file setting. If you write code that uses a config setting, it might be worth adding to the standard codebase, as I doubt you're the first one to run across this. Alternately, you could do it in tcl code, by setting up a trace filter (with ns_register_filter) that writes out a different log file with exactly what you need. -J Hossein Sharifi wrote: I've been meaning to write about this for a while: When I switched from AOLserver 3.x to 4.0 a few years ago, I noticed that the IP address in the log file no longer always matches what [ns_conn peeraddr] reports. ns_conn seems to always report the actual IP address of the user, whereas the log files will gladly accept whatever is in the X-Forwarded-For header that the client sends, even if it's forged or nonsensical.This makes it difficult to detect and track bot behavior and other abuses. A significant portion of bot activity on my site is logged as 127.0.0.1, unknown, 10.0.0.50 or other similar false values. Is there any way to make AOLserver log the real IP address and ignore the X-Forwarded-For header? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer 4.x blindly reporting X-Forwarded-For value in logs
Hello! You can use HAProxy or other reverse-proxy for more performance and logging. Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] AOLServer 4.x blindly reporting X-Forwarded-For value in logs
Just a heads up - One possible side-effect could be that if you have a proxy in place in front of your aolserver, you might lose the ability to track unique ip's, and just catch the proxy's ip. Most modern proxy's set the x- forwarded-for to enable you to delineate end-user ips. -j On Aug 18, 2009, at 2:33 PM, Jeff Rogers wrote: There is no built-in setting to log or not log forwarded headers. It's not difficult to change, but it requires a little programming. If you are comfortable with C, you can edit nslog/nslog.c and change the behaviour with X-Forwarded-For (it's at nslog.c:272 in my copy). You could disable the check and always log the real ip, log both the real and forwarded header, or make it dependent on a config file setting. If you write code that uses a config setting, it might be worth adding to the standard codebase, as I doubt you're the first one to run across this. Alternately, you could do it in tcl code, by setting up a trace filter (with ns_register_filter) that writes out a different log file with exactly what you need. -J Hossein Sharifi wrote: I've been meaning to write about this for a while: When I switched from AOLserver 3.x to 4.0 a few years ago, I noticed that the IP address in the log file no longer always matches what [ns_conn peeraddr] reports. ns_conn seems to always report the actual IP address of the user, whereas the log files will gladly accept whatever is in the X- Forwarded-For header that the client sends, even if it's forged or nonsensical.This makes it difficult to detect and track bot behavior and other abuses. A significant portion of bot activity on my site is logged as 127.0.0.1, unknown, 10.0.0.50 or other similar false values. Is there any way to make AOLserver log the real IP address and ignore the X-Forwarded-For header? -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. Joseph Kondel Doer of Deeds, Gentleman of Leisure (c) 202-262-8964 -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to lists...@listserv.aol.com with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. smime.p7s Description: S/MIME cryptographic signature