<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.comp.web.aolserver">
    <title>gmane.comp.web.aolserver</title>
    <link>http://blog.gmane.org/gmane.comp.web.aolserver</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15338"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15335"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15331"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15328"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15327"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15227"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15226"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15225"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15209"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15208"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15202"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15200"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15195"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15194"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15188"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15181"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15151"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15150"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15149"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.aolserver/15138"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15338">
    <title>ns_adp_parse ignore safe option</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15338</link>
    <description>Hello!

In page 
http://dev.aolserver.com/wiki/Ns_adp_parse
is writed "If you specify the -safe flag, then only registered tags are 
executed; inline scripts using "&lt;% ... %&gt;" or "&lt;%= ... %&gt;" are ignored."

I'm try to using 
ns_adp_parse -file -safe $fname
and &lt;% ... %&gt; sections are executed! It's very unsecure for me.

What can I do? I'm using AOLServer 4.0.10-7 from debian etch.

Best regards, Alexey.


</description>
    <dc:creator>Alexey Pechnikov</dc:creator>
    <dc:date>2008-09-05T11:19:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15335">
    <title>Problem running Aolserver with Valgrind</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15335</link>
    <description>Hi,

I've been trying to get aolserver to run on Valgrind for a week now
and it does work to a certain extent.  My Aolserver interfaces with
Oracle databases and my problem is that when I do run aolserver on
valgrind and nsoracle driver attempts to connect to Oracle, I get a
OCIServerAttach ()': ORA-12546: TNS: Permission Denied error.  I'm not
sure why it's doing this.  It works fine without valgrind.

I've even set my permissions bits on oracle binary as rwsrwsrwx.  It's
still not working.  I need help, please. :(

I don't know where to look.

Thanks.

Sep


</description>
    <dc:creator>Sep Ng</dc:creator>
    <dc:date>2008-09-02T01:14:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15331">
    <title>problem getting binary data from C to a tcl object to an aolserver connection</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15331</link>
    <description>Hi all,

If I Ns_Log() the data in a (char *) I can clearly see that it
contains newlines, and I can also verify that it contains nulls with
memchr.

I have tried any number of ways to turn it into a tcl object, eg:

            objPtr = Tcl_NewByteArrayObj(str, length);

or

            objPtr = Tcl_NewObj();
            Tcl_AppendToObj(objPtr, str, length);

or

            objPtr = Tcl_NewStringObj(str, length);

etc.

this is then set as the result object, and control returns to the tcl
code. Whether the tcl code then does an ns_log, ns_return (which I
know isn't supposed to be binary safe) or ns_write, i get all the
newlines converted into \n (ie. two characters \ then n) and chunks of
binary get converted to unicode characters.

I can see from Tcl_AppendToObj that that is supposed to happen there,
but how can I output a byte array object without it being converted to
utf8?

Any help appreciated - this is driving me nuts :)


</description>
    <dc:creator>Mark Aufflick</dc:creator>
    <dc:date>2008-08-28T08:50:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15328">
    <title>ns_ldap and ldap bind command</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15328</link>
    <description>Hi all,

Researching the use of ns_ldap in OpenACS it seems that the version of
ns_ldap in wide use is http://www.sussdorff.de/resources/nsldap.tgz
which seems to have additional support for ldap bind (note I am not an
LDAP expert so forgive me if I'm using the wrong lingo).

The diff is pasted below. Should this be committed to the tree?

diff -r nsldap/nsldap.c nsldap-sussdorf/nsldap.c
1373a1374
1796a1798,1820
diff -r nsldap/README nsldap-sussdorf/README
186a187,191


</description>
    <dc:creator>Mark Aufflick</dc:creator>
    <dc:date>2008-08-24T10:53:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15327">
    <title>PATCH: Support ipv6</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15327</link>
    <description>Hi,

Ipv6 is becoming more important, with only only a few years of ipv4 
address space left and governments starting to require it when doing 
business with them.

I'm running ipv6 myself for a while now, but my webservers are still ipv4 
only, because they run ipv4. So, I wrote a patch, downloadable here:

http://www.freepascal.org/~daniel/aolserver-ipv6support.diff

... it applies against AOLserver-cvs.

After applying the patch, AOLserver uses AF_INET6 rather than AF_INET. 
While of course, experimental, AOLserver seems to serve pages perfectly 
fine on both ipv4 and ipv6, with no impact on configuration files, or TCL 
code. Everywhere you could use an ipv4 address before, it now simply 
accepts both.

Daniël


</description>
    <dc:creator>Daniël Mantione</dc:creator>
    <dc:date>2008-08-23T15:18:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15227">
    <title>Data "corruption" with fastpath caching</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15227</link>
    <description>Consider the following pseudocode snippet:

     &lt;&lt;...generate file $myfile in some way...&gt;&gt;
     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 
other people's views are.  It's potentially a very serious issue given 
that it may silently "corrupt" data, and the fact that fastpath caching is 
enabled by default means that people may run into it without even knowing 
they're exposed to the danger.  The best workaround I can think of (short 
of a checksum, which would defeat the purpose of caching in the first 
place) would be to check that the mtime or ctime of the file is some 
threshold number of seconds (e.g. 1 or 2) less than the current time, and 
not serve the file from cache if it's not.  In other words, a file would 
have to be at least X seconds old (which could be a configurable value) 
before it could be served from the cache rather than from disk.

Thoughts?

- John


</description>
    <dc:creator>John Caruso</dc:creator>
    <dc:date>2008-08-18T19:33:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15226">
    <title>bookmooch on reddit</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15226</link>
    <description>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


</description>
    <dc:creator>Jeff Rogers</dc:creator>
    <dc:date>2008-08-01T01:55:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15225">
    <title>AOLServer and Tcl classes available in Virginia in Oct</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15225</link>
    <description>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


</description>
    <dc:creator>Jeff Hobbs</dc:creator>
    <dc:date>2008-07-23T17:00:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15209">
    <title>Custom server error page crash</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15209</link>
    <description>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


</description>
    <dc:creator>William Scott Jordan</dc:creator>
    <dc:date>2008-07-10T02:15:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15208">
    <title>Upload size limits</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15208</link>
    <description>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




</description>
    <dc:creator>Jay Rohr</dc:creator>
    <dc:date>2008-07-10T01:10:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15202">
    <title>Troubleshooting PHP support</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15202</link>
    <description>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


</description>
    <dc:creator>Michael Steigman</dc:creator>
    <dc:date>2008-07-01T20:53:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15200">
    <title>Trouble with NSGD Installation</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15200</link>
    <description>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


</description>
    <dc:creator>Matthew Gagen</dc:creator>
    <dc:date>2008-06-20T18:33:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15195">
    <title>Control Port on AOLserver 4.5</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15195</link>
    <description>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&gt; expr 2+2
tlc:nscp 2&gt;


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


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Bernhard van Woerden</dc:creator>
    <dc:date>2008-06-10T15:37:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15194">
    <title>FW: Nspostgres Segmentation fault problem</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15194</link>
    <description> 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


</description>
    <dc:creator>Agnieszka Kukałowicz</dc:creator>
    <dc:date>2008-05-21T07:00:44</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15188">
    <title>ns_sock_select issues again</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15188</link>
    <description>I’m having problems with ns_httpget on my Win32, 4.5.0, Tcl 8.5.  Again I’ve narrowed it down to the ns_sock_select in _ns_http_puts (defined in modules/tcl/http.tcl).  It’s not crashing now like it did with 4.0.10, Tcl 8.4.17 (you may recall a month ago I was getting an “UpdateStringProc should not be invoked for type bytecode” error then).  Now it just errors out like so:

invalid command name "ƒÄ,¶——"
    while executing
"Ä,¶——"
    (procedure "_ns_http_puts" line 1)
    invoked from within
"_ns_http_puts $timeout $wfd "$method $uri HTTP/1.0\r""
    invoked from within
"ns_httpopen GET $url $rqset $timeout"
    (procedure "ns_httpget" line 10)
    invoked from within
"ns_httpget http://www.google.com/"

I’m guessing the gobbledygook is some sort of representation of ns_sockselect.  Is this at all related to the UpdateStringProc error from before?  Is it bytecode pretending to be a string?  Must be, because if I put together the series of commands leading up to it, like so:

set fds [ns_sockopen -nonblock www.google.com 80]
set rfd [lindex $fds 0]
set wfd [lindex $fds 1]
if {[lindex [ns_sockselect -timeout 30 {} $wfd {}] 1] == ""} {
    error "Foo"
}
puts $wfd "GET / HTTP/1.0\r"

it works but if I use _ns_http_puts like this:

set fds [ns_sockopen -nonblock www.google.com 80]
set rfd [lindex $fds 0]
set wfd [lindex $fds 1]
_ns_http_puts 30 $wfd "GET / HTTP/1.0\r"

It throws the error again.  I’m beyond my depth figuring out why this would be the case.

I guess it could be something about the system I’m on, since it seems like the same problem has manifested itself twice with two different versions of both AOLserver and Tcl codebases, and two different compilers even.  The only common denominator is this Win2k3 Server box I’m on, which isn’t all that special as far as I can tell.  I’ll try to find another machine to try it out on.

In the meantime, any ideas on what is causing this?

Titi Ala'ilima
Lead Architect
MedTouch LLC
1100 Massachusetts Avenue
Cambridge, MA 02138
617.621.8670 x309



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Titi Alailima</dc:creator>
    <dc:date>2008-05-07T18:54:45</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15181">
    <title>Rolling logs in Windows</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15181</link>
    <description>Anyone know how to signal nsd in Windows to roll the logs?  Any equivalent of "kill -HUP"?

Titi Ala'ilima
Lead Architect
MedTouch LLC
1100 Massachusetts Avenue
Cambridge, MA 02138
617.621.8670 x309



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Titi Alailima</dc:creator>
    <dc:date>2008-05-06T19:12:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15151">
    <title>oci_error_p - nsoracle.c - talking about memory allocation...</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15151</link>
    <description>Dear all,

                Id like to report a memory allocation problem in the
function oci_error_p, belonging to the module nsoracle.c.

 

When the system is used on Windows and Oracle (via plsql) execute a
raise_application_error, Aolserver (nsd) stops working.

 

Leta analyse the code

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    char             *msgbuf;    ß dynamic memory allocation

    char             *buf;       ß dynamic memory allocation

    char              exceptbuf[EXCEPTION_CODE_SIZE + 1];  ß allocation on
the stack

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß
dynamic creation of msgbuf

    buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß dynamic
creation of buf

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf); ß here exceptbuf (allocated on
the stack) and buf (dimanically allocated) are

                                               passed to Ns_DbSetException 

 

    Ns_Free(msgbuf); ß destruction of msgbuf

    Ns_Free(buf); ß destruction of buf

 

    return 1; ß after this return neither msgbuf and buf (already destroyed)
nor exceptbuf (on the stack) do formally exists

                 

}

 

This code DOES work on Linux. In Windows, when  raise_application_error is
called the code BREAKS the server.

 

To make it work I had to change the code as follows:

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    static char       msgbuf[STACK_BUFFER_SIZE +1]; ß static memory
allocation of msgbuf

    static            buf[STACK_BUFFER_SIZE +1]; ß static memory allocation
of buf

    static char       exceptbuf[EXCEPTION_CODE_SIZE + 1]; ß static memory
allocatin of exceptbuf

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    // msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    // buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf);

 

    // Ns_Free(msgbuf);

    // Ns_Free(buf);

 

    return 1;

}

 

Any suggestion on why this is happening? How about incorporating these
changes in the standard nsoracle.c module?

 

Thanks in advance,

Maurizio

 

 

 



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Maurizio Martignano</dc:creator>
    <dc:date>2008-05-04T08:26:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15150">
    <title>oci_error_p - nsoracle.c - talking about memory allocation...</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15150</link>
    <description>Dear all,

                Id like to report a memory allocation problem in the
function oci_error_p, belonging to the module nsoracle.c.

 

When the system is used on Windows and Oracle (via plsql) execute a
raise_application_error, Aolserver (nsd) stops working.

 

Leta analyse the code

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    char             *msgbuf;    ß dynamic memory allocation

    char             *buf;       ß dynamic memory allocation

    char              exceptbuf[EXCEPTION_CODE_SIZE + 1];  ß allocation on
the stack

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß
dynamic creation of msgbuf

    buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß dynamic
creation of buf

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf); ß here exceptbuf (allocated on
the stack) and buf (dimanically allocated) are

                                               passed to Ns_DbSetException 

 

    Ns_Free(msgbuf); ß destruction of msgbuf

    Ns_Free(buf); ß destruction of buf

 

    return 1; ß after this return neither msgbuf and buf (already destroyed)
nor exceptbuf (on the stack) do formally exists

                 

}

 

This code DOES work on Linux. In Windows, when  raise_application_error is
called the code BREAKS the server.

 

To make it work I had to change the code as follows:

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    static char       msgbuf[STACK_BUFFER_SIZE +1]; ß static memory
allocation of msgbuf

    static            buf[STACK_BUFFER_SIZE +1]; ß static memory allocation
of buf

    static char       exceptbuf[EXCEPTION_CODE_SIZE + 1]; ß static memory
allocatin of exceptbuf

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    // msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    // buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf);

 

    // Ns_Free(msgbuf);

    // Ns_Free(buf);

 

    return 1;

}

 

Any suggestion on why this is happening? How about incorporating these
changes in the standard nsoracle.c module?

 

Thanks in advance,

Maurizio

 

 



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Maurizio Martignano</dc:creator>
    <dc:date>2008-05-04T08:11:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15149">
    <title>oci_error_p - nsoracle.c - talking about memory allocation...</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15149</link>
    <description>Dear all,

                Id like to report a memory allocation problem in the
function oci_error_p, belonging to the module nsoracle.c.

 

When the system is used on Windows and Oracle (via plsql) execute a
raise_application_error, Aolserver (nsd) stops working.

 

Leta analyse the code

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    char             *msgbuf;    ß dynamic memory allocation

    char             *buf;       ß dynamic memory allocation

    char              exceptbuf[EXCEPTION_CODE_SIZE + 1];  ß allocation on
the stack

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß
dynamic creation of msgbuf

    buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));  ß dynamic
creation of buf

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf); ß here exceptbuf (allocated on
the stack) and buf (dimanically allocated) are

                                               passed to Ns_DbSetException 

 

    Ns_Free(msgbuf); ß destruction of msgbuf

    Ns_Free(buf); ß destruction of buf

 

    return 1; ß after this return neither msgbuf and buf (already destroyed)
nor exceptbuf (on the stack) do formally exists

                 

}

 

This code DOES work on Linux. In Windows, when  raise_application_error is
called the code BREAKS the server.

 

To make it work I had to change the code as follows:

 

static int

oci_error_p(const char *file, int line, const char *fn,

            Ns_DbHandle * dbh, char *ocifn, char *query,

            oci_status_t oci_status)

{

    ora_connection_t *connection = 0;

    ub2               offset = 0;

    sb4               errorcode = 0;

 

    static char       msgbuf[STACK_BUFFER_SIZE +1]; ß static memory
allocation of msgbuf

    static            buf[STACK_BUFFER_SIZE +1]; ß static memory allocation
of buf

    static char       exceptbuf[EXCEPTION_CODE_SIZE + 1]; ß static memory
allocatin of exceptbuf

 

    if (dbh) {

        connection = dbh-&gt;connection;

    }

 

    if (oci_status == OCI_SUCCESS)

        return 0;

 

    /* Until we get the logging situation worked out, return

     * OCI_SUCCESS_WITH_INFO as a pure success.

     */

    if (oci_status == OCI_SUCCESS_WITH_INFO)

        return 0;

 

    /* If the query is long, nilp will return "[too long]"; 

     * if null (we're not doing a query yet, e.g., could 

     * be opening db), then "[nil]"  

     */

    query = nilp(query);

 

    // msgbuf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    // buf = (char *) Ns_Malloc(STACK_BUFFER_SIZE * sizeof(char));

    *msgbuf = 0;

 

    switch (oci_status) {

 

        case OCI_NEED_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NEED_DATA");

            break;

        case OCI_NO_DATA:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_NO_DATA");

            break;

        case OCI_ERROR:

 

            if (connection == 0)

                snprintf(msgbuf, STACK_BUFFER_SIZE, "NULL connection");

            else {

                oci_status_t oci_status1;

                char         errorbuf[1024];

 

                oci_status1 = OCIErrorGet(connection-&gt;err,

                                          1,

                                          NULL,

                                          &amp;errorcode,

                                          errorbuf,

                                          sizeof errorbuf, OCI_HTYPE_ERROR);

                if (oci_status1) {

                    snprintf(msgbuf, STACK_BUFFER_SIZE,

                             "`OCIErrorGet ()' error");

                } else {

                    snprintf(msgbuf, STACK_BUFFER_SIZE, "%s", errorbuf);

                }

 

                oci_status1 = OCIAttrGet(connection-&gt;stmt,

                                         OCI_HTYPE_STMT,

                                         &amp;offset,

                                         NULL,

                                         OCI_ATTR_PARSE_ERROR_OFFSET,

                                         connection-&gt;err);

 

                if (errorcode == 1041 || 

                    errorcode == 3113 || 

                    errorcode == 12571 ||

                    errorcode == 28 ||

                    errorcode == 1012 ||

                    errorcode == 24324) {

 

                    /* 3113 is 'end-of-file on communications channel',
which

                     *      happens if the oracle process dies

                     * 12571 is TNS:packet writer failure, which also
happens if

                     *      the oracle process dies

                     * 1041 is the dreaded "hostdef extension doesn't exist
error,

                     *      which means the db handle is screwed and can't
be used

                     *      for anything else.

                     *

                     * In either case, close and re-open the handle to clear
the

                     * error condition

                     */

                    Ns_OracleFlush(dbh);

                    Ns_OracleCloseDb(dbh);

                }

 

                if (errorcode == 20 || errorcode == 1034) {

                    /* ora-00020 means 'maximum number of processes
exceeded.

                     * ora-01034 means 'oracle not available'.

                     *           we want to make sure the oracleSID process

                     *           goes away so we don't make the problem
worse

                     */

                    Ns_OracleCloseDb(dbh);

                }

            }

            break;

        case OCI_INVALID_HANDLE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_INVALID_HANDLE");

            break;

        case OCI_STILL_EXECUTING:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error -
OCI_STILL_EXECUTING");

            break;

        case OCI_CONTINUE:

            snprintf(msgbuf, STACK_BUFFER_SIZE, "Error - OCI_CONTINUE");

            break;

    }

 

    if (((errorcode == 900) || (offset &gt; 0)) &amp;&amp; (strlen(query) &gt;= offset)) {

        /* ora-00900 is invalid sql statment

         *           it seems to be the msg most likely to be a parse

         *           error that sets offset to 0

         */

        int len;

        len = snprintf(buf, STACK_BUFFER_SIZE,

                       "%s:%d:%s: error in `%s ()': %s\nSQL: ",

                       file, line, fn, ocifn, msgbuf);

        if (offset &gt; 0)

            len +=

                snprintf(buf + len, STACK_BUFFER_SIZE - len, "%.*s",

                         offset - 1, query);

 

        snprintf(buf + len, STACK_BUFFER_SIZE - len, " !&gt;&gt;&gt;!%s",

                 query + offset);

    } else {

        snprintf(buf, STACK_BUFFER_SIZE,

                 "%s:%d:%s: error in `%s ()': %s\nSQL: %s",

                 file, line, fn, ocifn, msgbuf, query);

    }

 

    Ns_Log(Error, "%s", buf);

 

    /* We need to call this so that AOLserver will print out the relevant

     * error on pages served to browsers where ClientDebug is set.

     */

    snprintf(exceptbuf, EXCEPTION_CODE_SIZE, "%d", (int) errorcode);

    Ns_DbSetException(dbh, exceptbuf, buf);

 

    // Ns_Free(msgbuf);

    // Ns_Free(buf);

 

    return 1;

}

 

Any suggestion on why this is happening? How about incorporating these
changes in the standard nsoracle.c module?

 

Thanks in advance,

Maurizio

 

 



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to &lt;listserv&lt; at &gt;listserv.aol.com&gt; with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
</description>
    <dc:creator>Maurizio Martignano</dc:creator>
    <dc:date>2008-05-04T08:09:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15138">
    <title>Tcl rounding question</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15138</link>
    <description>Hey all!

This is really more of a tcl question, but I'm hoping that someone on 
the list might have an explanation.  Why does [format %.2f 18.005] round 
down to "18.00" and [format %.2f 1.415] round up to "1.42"?  Any 
guesses?  Am I missing something obvious here?

Tcl version 8.4, if it matters.

Thanks!

-William


</description>
    <dc:creator>William Scott Jordan</dc:creator>
    <dc:date>2008-05-03T22:31:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.aolserver/15137">
    <title>"Fun, free applications for building personal sites."</title>
    <link>http://comments.gmane.org/gmane.comp.web.aolserver/15137</link>
    <description>Back in Feburary 2005, Dan Chak at MIT said something to me that I just
haven't had the motivation to pursue.  However, I really would like to
hear what folks think of his statement:

    &gt; What AOLServer "community" needs is a bunch of fun, free
    &gt; applications  for building personal sites.  It's stupid, but
    &gt; that's how you get the  initial hook on people.  I'm not sure who
    &gt; is going to make and release  these "fun, free apps" though,
    &gt; because there's currently also no  audience for it.  It's kind of
    &gt; a bootstrapping problem.

It's definitely a chicken-and-egg problem: most newbies won't try
AOLserver "for the heck of it" but would go through the trouble if there
was an application they wanted to run, i.e. OpenACS.

Of course, there's little motivation to develop a fun, free app. for
AOLserver if nobody's going to try it out.

How do we break out of this deadlock?

</description>
    <dc:creator>Dossy Shiobara</dc:creator>
    <dc:date>2008-05-03T22:03:01</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.comp.web.aolserver">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.web.aolserver</link>
  </textinput>
</rdf:RDF>
