John Caruso | 19 Aug 02:25

Re: Data "corruption" with fastpath caching

On Monday 04:56 PM 8/18/2008, Jade Rubick wrote:
>Consider this use case:
>    * You use git or another version control system to store for a bunch 
> of static html files you serve with Aolserver.
>    * You check out all of your static html files. Because they're all 
> checked out at the same time, many of them have identical timestamps.
>Could the user get the wrong version of an html file they're being 
>served?

Nope, because in this case the inodes for the files would be different, so 
fastpath caching would distinguish them.

>What about this scenario:
>    * You have a web application that allows administrators on various 
> sites hosted on your application to download a list of user names and 
> passwords (this is a slightly contrived example). They can download it 
> to CSV.
>    * Admin #1 generates this file. You create a unique filename for 
> their site_id, because you want a unique filename to return back to the 
> user: site-1234-passwords.csv. You return this file to the admin.
>    * Admin #2 generates their file. You create a unique filename for 
> their site_id, because you want a unique filename to return back to the 
> user: site-5000-passwords.csv. You attempt to return this file to the 
> admin. Because their request was in the same second, however, they get 
> site-1234-passwords.csv?
Yep, it could happen in this case, assuming the files are deleted after 
they're returned to the user via ns_returnfile.

As I mentioned, this bug wasn't discovered through code review or any 
theoretical process--it was causing problems in live code, and it was 
(Continue reading)

John Caruso | 18 Aug 21:31

Data "corruption" with fastpath caching

Consider the following pseudocode snippet:

     <<...generate file $myfile in some way...>>
     ns_returnfile 200 text/plain $myfile
     ns_unlink $myfile

If this snippet is executed in a tight loop on a Linux system, the chances 
of returning the wrong results are very high due to AOLserver's fastpath 
caching, which requires the following four attributes to be identical to 
consider a new file to be a cache hit (as per the FastReturn function in 
fastpath.c):

1) Same device number
2) Same inode number
3) Same modification time (within one second)
4) Same size

Assuming $myfile is always on the same filesystem, number 1 is taken care 
of, and Linux reuses inode numbers, so the creation and deletion of 
$myfile will typically result in a file with the same inode.  So in this 
example, files created within a given second that contains the same amount 
of data as a preceding file created within that same second will be 
considered identical, and will be erroneously served from cache.

This isn't just a hypothetical, BTW; a client of mine ran into this issue 
and spent many weeks trying to figure out what was happening before 
tracing it back to AOLserver's fastpath caching.  And the issue had 
existed for many years without being detected.

I'm mainly bringing this up to shine a light on the issue and see what 
(Continue reading)

Jeff Rogers | 1 Aug 03:55

bookmooch on reddit

Just noticed that bookmooch is #6 on the reddit homepage.  I seem to 
recall that bookmooch was running aolserver backed by bdb on just one or 
two servers - is that still the case?  What I was wondering more of 
course is if there was any notable traffic spike from the reddit mention 
and if aolserver handled any spike without problems.

-J

Jeff Hobbs | 23 Jul 18:57

AOLServer and Tcl classes available in Virginia in Oct

Hi all,

Just a short FYI that the upcoming Tcl conference will have tutorial 
sessions that include AOLServer and OpenACS tutorials.  I'm forwarding 
along this short note from the conference chair:

AOLServer and Tcl classes available in Virginia

Training sessions for AOLServer and Tcl will be offered at the annual
Tcl/Tk Conference being held in Manassas, Virginia, October 20-24.

The classes are taught by industry experts and professional educators.

Conference membership is not required to attend a tutorial.

Details at:
     http://www.tcl.tk/community/tcl2008

I hope to see some of you there.

Regards,

Jeff

William Scott Jordan | 10 Jul 04:12

Custom server error page crash

Hey all!

I've recently added a custom server error message using a redirect in 
AOLserver's config file.  Since then, I've been occasionally seeing the 
following error in the logs:

[09/Jul/2008:18:04:08][30505.1690512][-conn:1-] Error: return: failed to 
redirect 'PROPFIND /500.html': exceeded recursion limit of 3

There will be several thousand of those entries in a row, followed by a 
server crash.  I don't see anything in the logs to indicate what may 
have initiated the error in the first place.  And the entries continue 
even after the server reboots.

At first, I thought there might be an error in the server error page 
itself, so I switched it from being a dynamically generated page to 
being a static HTML file, which goes through no filtering, but that 
didn't solve the problem.

Does anyone have any thoughts on what might be going on?

Thanks!

-Scott

Jay Rohr | 10 Jul 03:08

Upload size limits

Did the method of specify the max upload size change in 4.5?

4.0.x was "ns_param   maxinput        [expr 1024 * 1024 * 1024]"

Jay

Michael Steigman | 1 Jul 22:52

Troubleshooting PHP support

Hi all,

I'm attempting to get PHP working with Aolserver 4.5 as a workaround  
in a time crunch here. OS is RHEL 4. I compiled PHP5 in a VM that is  
basically identical to my production server and it worked like a  
charm. On the production box, however, the script produces no output  
and the response headers say "500 internal server error". There is  
nothing in the error log (debugging turned on). For the sake of it, I  
tried PHP4; again, it compiled just fine and loads OK at server  
startup but no output. This time I got a "200 OK" message in the  
response headers, though. Nothing in the logs again.

Can anyone give me some pointers on how to troubleshoot this?

Thanks in advance.

Michael

Matthew Gagen | 20 Jun 20:33

Trouble with NSGD Installation

I'm having trouble getting NSGD to compile correctly in Ubuntu. I was
wondering if anyone has had any experience getting it to compile
successfully on a linux OS. There were a few warning messages during the
compile process, and the module would not load when aolserver was started
up. Also there's an issue that make was creating two .so files (these are
shared libraries on Linux), nsgd and libnsgd.  I have Ubuntu 8.04 and
AOLServer 4.5 in case that information is needed. 

Thanks,
Matthew Gagen

Bernhard van Woerden | 10 Jun 17:34

Control Port on AOLserver 4.5

I'm trying out AOLserver4.5 on FreeBSD7 and can't get the control port to echo back the results of a command

e.g.

Welcome to nsd running at /usr/local/aolserver/bin/nsd (pid 1522)
AOLserver/4.5.0 (aolserver4_5) for freebsd built on May 23 2008 at 17:06:51
CVS Tag: $Name: aolserver_v45_r0 $
tlc:nscp 1> expr 2+2
tlc:nscp 2>


Has anyone else seen this or know how to fix it ?
I'm not sure of this is FreeBSD specific but AOLserver 4.10 worked fine.


Many thanks
Bernhard

FW: Nspostgres Segmentation fault problem

 Hi,

 I have problem With AOLserver 4.0.10 and nspostgres version 4.
 When Postgresql database is unaccessible for a while AOLserver is dying
 with the error:

 19/May/2008:09:55:51][14192.3068214160][-conn:server1::29] Error:
 dbinit: error(10.0.200.200::server1,server closed the connection
 unexpectedly
         This probably means the server terminated abnormally
         before or while processing the request.
 ): 'select sec_id_seq.nextval'

 Program received signal SIGSEGV, Segmentation fault.

 In GDB, backtrace shows:

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread -1226753136 (LWP 14239)]
 0x00a708ef in DbFail (interp=0x139ac2c0, handle=0x8dbf3b8,
 cmd=0x18b436f0 "0or1row", sql=0x18b4c8f0 "select sec_id_seq.nextval")
 at nspostgres.c:1131
 1131      if (pqerror[0] != '\0') {
 (gdb) bt
 #0  0x00a708ef in DbFail (interp=0x139ac2c0, handle=0x8dbf3b8,
 cmd=0x18b436f0 "0or1row", sql=0x18b4c8f0 "select sec_id_seq.nextval")
 at nspostgres.c:1131
 #1  0x00a71565 in PgBindCmd (dummy=0x0, interp=0x139ac2c0, argc=4,
 argv=0xb6e0dc38) at nspostgres.c:1477
 #2  0x006e0145 in TclInvokeStringCommand (clientData=0x13989bb8,
 interp=0x139ac2c0, objc=4, objv=0xb6e0de5c) at
 ./../generic/tclBasic.c:1778
 #3  0x006e17c5 in TclEvalObjvInternal (interp=0x139ac2c0, objc=4,
 objv=0xb6e0de5c, command=0x774072 "", length=0, flags=262144)
     at ./../generic/tclBasic.c:3088

 I've tried to change nspostgres.so to newer version (4r1) from CVS but
 the problem still exists:

 [19/May/2008:10:37:55][15960.3068312464][-conn:server1::23] Notice:
 Ns_PgExec: Trying to reopen database connection
 [19/May/2008:10:37:55][15960.3068312464][-conn:server1::23] Fatal:
 received fatal signal 11

 And backtrace is:
 gdb) bt
 #0  0x004f1402 in __kernel_vsyscall ()
 #1  0x009eada0 in *__GI_raise (sig=6) at
 ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 #2  0x009ec781 in *__GI_abort () at abort.c:88
 #3  0x00a2196b in __libc_message (do_abort=2, fmt=0xae8564 "*** glibc
 detected *** %s: %s: 0x%s ***\n") at
 ../sysdeps/unix/sysv/linux/libc_fatal.c:170
 #4  0x00a296a6 in _int_free (av=0xb02120, mem=0x9d6aa88) at
 malloc.c:5758
 #5  0x00a2cc10 in *__GI___libc_free (mem=0x9d6aa88) at malloc.c:3541
 #6  0x005b14b0 in DLFreeList (list=0x9ccb688) at dllist.c:69
 #7  0x005a29ae in closePGconn (conn=0xb587d70) at fe-connect.c:2119
 #8  0x005a2c05 in PQfinish (conn=0xb587d70) at fe-connect.c:2148
 #9  0x0013f004 in Ns_PgExec (handle=0x97b35b8, sql=0xefca8a8 "select
 sec_id_seq.nextval") at nspostgres.c:368
 #10 0x001337af in Ns_DbExec (handle=0x97b35b8, sql=0xefca8a8 "select
 sec_id_seq.nextval") at dbdrv.c:415
 #11 0x001336d0 in Ns_DbSelect (handle=0x97b35b8, sql=0xefca8a8 "select
 sec_id_seq.nextval") at dbdrv.c:372
 #12 0x00137381 in Ns_Db0or1Row (handle=0x97b35b8, sql=0xefca8a8 "select
 sec_id_seq.nextval", nrows=0xb6d11af4) at dbutil.c:103
 #13 0x00141b13 in PgBindCmd (dummy=0x0, interp=0xeb49d58, argc=4,
 argv=0xb6d11c38) at nspostgres.c:1628
 #14 0x00209145 in TclInvokeStringCommand (clientData=0xeb64818,
 interp=0xeb49d58, objc=4, objv=0xb6d11e5c) at
 ./../generic/tclBasic.c:1778
 #15 0x0020a7c5 in TclEvalObjvInternal (interp=0xeb49d58, objc=4,
 objv=0xb6d11e5c, command=0x29d072 "", length=0, flags=262144)
     at ./../generic/tclBasic.c:3088

 Best regards
 Agnieszka Kukalowicz

Titi Alailima | 7 May 21:31

Re: ns_sock_select issues again

I tried a couple more things.  I re-defined _ns_http_puts with the original definition and everything worked fine.  This got me curious so I ran [info body _ns_http_puts] (in a new interpreter where I hadn’t redefined the proc) and of course I got “ƒÄ,¶——“.

 

A workaround is obvious, but the mystery remains as to how the proc got redefined with the gobbledygook in the first place.  It might not be ns_sockselect after all, though I was able to narrow it down to that in the 4.0.10 case.  It must happen before my custom libraries are processed or else my redefinition wouldn’t fix the problem.

 

Titi Ala'ilima

Lead Architect

MedTouch LLC

1100 Massachusetts Avenue

Cambridge, MA 02138

617.621.8670 x309

 

 


Gmane