Title: Re: freeradius 1.0.0 crashes on oracle errors

> Message: 12
> Date: Tue, 31 Aug 2004 12:13:46 +0300
> From: Kostas Zorbadelos <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: freeradius 1.0.0 crashes on oracle errors
> Reply-To: [EMAIL PROTECTED]
>
> On Tue, Aug 31, 2004 at 12:35:18PM +0400, Alexander Serkin wrote:
> > Hello.
> > I see a lot of 1401 errors in radiusd.log. But they does
> not lead to core
> > dumps.
> > Radiusd performs correctly.
> > These errors come when users supply incorrect usernames
> those are longer
> > than the username column size.
> > We work on SPARC Solaris 2.8, gcc 3.3, Oracle 9.2.0.5,
> freeradius-1.0.0..
> >
>
> Hmmm. I have a different compiler version and older Oracle version
> (8.1.7). Have you tried to cause the 1401 error continously and not
> sporadically? You can do that with radclient.
>
> Anyway I will submit a bug report with the gdb output.

> > > Kostas Zorbadelos <[EMAIL PROTECTED]> wrote:
> > > > My environment is Solaris 2.8, gcc 2.95.3, Oracle 8.1.7.
> > > > Freeradius crashes (and core dumps) after an sql query
> causes an error
> > > > with an Oracle backend database.
> > >
> > >   Yuck.
> > >
> > > > First of all in oraclesql.conf there is a typo in
> > > > accounting_start_query_alt query:
> > >
> > >   Fixed, thanks.
> > >
> > > > Secondly, I caused the crash by sending an accounting
> start packet
> > > > with very large acct-session-id, that caused an
> ORA-01401(: inserted
> > > > value too large for column) error.
> > >
> > >   Ok.  The server *should* be robust in the face of such errors.
> > >
> > > > Should I submit a bug report in bugs.freeradius.org?
> > >
> > >   Please.
> > >
> > > > For anything else you might need to trace the error,
> please let me
> > > > know.
> > >
> > >   A gdb 'bt', so we can see where/when the error occured.
> > >
> > >   If you have access to a Linux box, you can try running it under
> > > "valgrind", which should give you more information about
> the invalid
> > > memory accesses.
> > >
> > >   Alan DeKok.
> > >
> > >
> > > -

I have been experiencing the exact same problem - a crash with repeated start packets. I have the same environment (O.S., gcc and freeradius).

I have found that as a test, a slight modification to sql_oracle.c to not return SQL_DOWN but -1 in sql_query as follows:

        x = OCIStmtExecute(oracle_sock->conn,
                                oracle_sock->queryHandle,
                                oracle_sock->errHandle,
                                (ub4) 1,
                                (ub4) 0,
                                (OCISnapshot *) NULL,
                                (OCISnapshot *) NULL,
                                (ub4) OCI_DEFAULT);

        if ((x != OCI_NO_DATA) && (x != OCI_SUCCESS)) {
                radlog(L_ERR,"rlm_sql_oracle: execute query failed in sql_query: %s",
                                sql_error(sqlsocket, config));
                /*return SQL_DOWN;*/
                return -1;
        }
Will remove this crash. A -1 here means that the connection is not re-opened after each error. I hope this helps us in finding the problem.

Regards,
OeH

Reply via email to