RE: freeradius 1.0.0 crashes on oracle errors

2004-09-02 Thread ElHassan, Omar
Title: RE: freeradius 1.0.0 crashes on oracle errors






More info. On this bug:


I have discovered that this problem occurs with or without using threads (i.e. radiusd -xx or radiusd -X).


Regards,
OeH
> -Original Message-
> From: ElHassan, Omar 
> Sent: Thursday, September 02, 2004 3:24 PM
> To: '[EMAIL PROTECTED]'
> Subject: 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
> 





Re: freeradius 1.0.0 crashes on oracle errors

2004-09-02 Thread Kostas Zorbadelos
On Thu, Sep 02, 2004 at 01:24:19PM +0800, ElHassan, Omar wrote:
> 
> 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

Very good Omar,
but what happens when all connections die in this way and are not
re-opened? Freeradius will remain running but with no connections to
the Oracle database. In conversations regarding this issue several
months ago, I was told that it is an error that has to do with the
re-open of the connections and you confirm that.
Anyway, i will submit a gdb traceback in bugs.freeradius.org. I only
hope that I will have time to do it today.
There is too much expertise here, to let the bug get away...

Thanks

Kostas  


-- 
  Kostas Zorbadelos
  Currently at: Otenet IT Department 
  mailto: [EMAIL PROTECTED]
  
  Out there in the darkness, out there in the night
  out there in the starlight, one soul burns brighter
  than a thousand suns.


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius 1.0.0 crashes on oracle errors

2004-09-01 Thread ElHassan, Omar
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





Re: freeradius 1.0.0 crashes on oracle errors

2004-08-31 Thread Kostas Zorbadelos
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.
> >
> >
> > -
> > List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
> >
> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> 

-- 
  Kostas Zorbadelos
  Currently at: Otenet IT Department 
  mailto: [EMAIL PROTECTED]
  
  Out there in the darkness, out there in the night
  out there in the starlight, one soul burns brighter
  than a thousand suns.


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius 1.0.0 crashes on oracle errors

2004-08-31 Thread Alexander Serkin
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..

> 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.
>
>
> -
> List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
>


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html