[AOLSERVER] ns_ora in Aolserver 4.5 for Win32

14 views
Skip to first unread message

Enrique Catalan

unread,
Apr 17, 2008, 5:17:25 AM4/17/08
to AOLS...@listserv.aol.com
Hi,

I have an issue when using the Aolserver 4.5 for Win32 port by friendlybits ( http://www.friendlybits.com/en/inf_tec_en/win32openacs_en/ ).  This version works pretty well on Windows Server 2003 except that there is a weird behavior with ns_ora when using Oracle 10g and when running the following command:

[ns_ora dml nsdb0
  begin
    raise_application_error (-20000, 'this is the user error message this is the user error message this is the user error message this is the user error message this is the user error message this is the user error message this is the user error message');
  end;
]

The server crahes with no errror message in the log.  Seems to be a memory leak in ns_ora.   I've tried the Oracle client 9i and the 10g and got the same on both.  The server crashes with different lenght of messages.  According to the Oracle doc, the limit of the message including the error code shouldn't exceed 512 characters.

I was wondering if you've had some similar issues before or just if you know if there is any known issue with ns_ora and Oracle 10g on Win32? 

Thanks in advance,
Enrique.

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

To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Enrique Catalan

unread,
Apr 22, 2008, 8:01:11 AM4/22/08
to AOLS...@listserv.aol.com
Hi,

I found that my server is crashing when it is at line 3905 on the nsoracle.c.

3905:      if (oci_error_p (lexpos (), dbh, "OCIStmtExecute", query, oci_status))
3906:    {
3907:          Tcl_SetResult(interp, dbh->dsExceptionMsg.string, TCL_VOLATILE);
3908:          flush_handle (dbh);
3909:          return TCL_ERROR;
3910:    }

The error in my Aolserver log just say:

Error: nsoracle.c:3905:<unknown>: error in `OCIStmtExecute ()': ORA-20015 ..... 

And then it just crashes :-( !

The ORA-20015 might vary between ORA-20000 and ORA-20099, which is the user customized code. and even if the length of message is short, after many raise_application_error() commands, it crashes.

I presume it is a buffer overflow since at the beginning of the nsoracle.c there is a line defining the buffer size, according to the oracle doc, this was limited on previous versions of oracle but from Oracle 10g and above this buffer size is unlimited.

Do you know what could be the problem with that?

Thanks in advance
-Enrique.

Dossy Shiobara

unread,
Apr 22, 2008, 8:27:20 AM4/22/08
to AOLS...@listserv.aol.com
On 2008.04.22, Enrique Catalan <e...@ECATALAN.COM> wrote:
> I found that my server is crashing when it is at line 3905 on the
> nsoracle.c.

What version of nsoracle are you using? The last tagged release, 2.8b1,
may have known bugs. CVS HEAD of nsoracle has a few changes:

http://aolserver.com/sf/cvs/nsoracle/ChangeLog?view=markup

I guess it's time to just tag nsoracle 2.9, maybe.

Can you try building the CVS HEAD version of nsoracle and see if that
resolves your crash bug?

--
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)

Enrique Catalan

unread,
Apr 22, 2008, 10:16:12 AM4/22/08
to AOLS...@listserv.aol.com
Hi Dossy,

Thanks for the link and indeed, that piece of code changed a lot with the new function free_fetch_buffers(connection);.

   if (oci_error_p (lexpos (), dbh, "OCIStmtExecute", query, oci_status)) {
        Ns_OracleFlush(dbh);
        free_fetch_buffers(connection);
        return TCL_ERROR;
    }

The version I'm using is the same as it is in http://www.friendlybits.com/en/inf_tec_en/win32openacs_en/ .   This is using nsoracle 2.7, afaik.  I have asked Maurizio if he could gently include the nsoracle 2.8 beta instead of the 2.7 and recompile the whole stuff together with this beta version..  Will let you know what happen at the end.

Thanks again!
Enrique.

Enrique Catalan

unread,
Apr 23, 2008, 5:53:46 AM4/23/08
to AOLS...@listserv.aol.com
Hi,

We've tried the new nsoracle 2.8 beta version and it is still crashing.  The error happens in different line but it seems to be the same issue, This time I got:

 Notice: nsoracle.c:1365:<unknown>: error in `OCIStmtExecute ()':

The block at Line 1365 is:
    if (oci_error_p
        (lexpos(), dbh, "OCIStmtExecute", query, oci_status)) {
        Tcl_SetResult(interp, dbh->dsExceptionMsg.string,
                      TCL_VOLATILE);
        Ns_OracleFlush(dbh);
        return TCL_ERROR;
    }

Do you have any ideas why it is crashing?

Thanks a lot,
Enrique.

Dossy Shiobara

unread,
Apr 23, 2008, 10:13:55 AM4/23/08
to AOLS...@listserv.aol.com
On 2008.04.23, Enrique Catalan <e...@ECATALAN.COM> wrote:
> Do you have any ideas why it is crashing?

Can you run AOLserver under gdb (there is a Cygwin-compiled Win32 binary
of gdb you can use, if you have Cygwin installed) and give us a
backtrace? Otherwise, you can use the free WinDbg tool from Microsoft:

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

If you're not familiar with gdb and/or WinDbg and need instructions on
how to elicit a backtrace, let me know and I'll try to write up some
docs.

Enrique Catalan

unread,
Apr 23, 2008, 10:34:46 AM4/23/08
to AOLS...@listserv.aol.com
Hi Dossy,

Thanks for the quick feedback. I used gdb long time ago but only in pure Linux, not cygwin.  I've never done this before on Windows so any doc/help would be really appreciated, I'll install WinDbg because there is no Cygwin on this machine and will try to get the backtrace.

Thanks again!
Enrique
Reply all
Reply to author
Forward
0 new messages