I am running Freeradius 0.9 and I am writing accounting records to an
Oracle DB ver 8i. If the Database goes down, the Freeradius gives a
segmentation fault error and dies. I've tried also to point to another
database as a fail-over option, but the same results were encountered.
Please find below the gdb output along with the debug output and the
configuration.

GDB output 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>

gdb /app/experimental/free-0.9/local/sbin/radiusd
/app/experimental/free-0.9/local/sbin/core
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are welcome to change it and/or distribute copies of it under certain
conditions. Type "show copying" to see the conditions. There is
absolutely no warranty for GDB.  Type "show warranty" for details. 
This GDB was configured as "sparc-sun-solaris2.8"
...(no debugging symbols found)
... Core was generated by `./radiusd'. 
Program terminated with signal 11, Segmentation fault. 
Reading symbols from /lib/libcrypt_i.so.1...(no debugging symbols
found)...done. 
Loaded symbols for /lib/libcrypt_i.so.1 Reading symbols from
/lib/librt.so.1...(no debugging symbols found)...done. Loaded symbols
for /lib/librt.so.1 Reading symbols from /lib/libpthread.so.1...(no
debugging symbols found)...done. Loaded symbols for /lib/libpthread.so.1
Reading symbols from
/app/experimental/free-0.9/local/lib/libradius-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/libradius-0.9.0.so
Reading symbols from /usr/local/lib/libsnmp-0.4.2.5.so...done.
Loaded symbols for /usr/local/lib/libsnmp-0.4.2.5.so
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libsocket.so.1...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libkstat.so.1...done.
Loaded symbols for /lib/libkstat.so.1
Reading symbols from /usr/local/lib/libltdl.so.3...done.
Loaded symbols for /usr/local/lib/libltdl.so.3
Reading symbols from /lib/libdl.so.1...done.
Loaded symbols for /lib/libdl.so.1
Reading symbols from /lib/libc.so.1...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /lib/libgen.so.1...done.
Loaded symbols for /lib/libgen.so.1
Reading symbols from /lib/libaio.so.1...done.
Loaded symbols for /lib/libaio.so.1
Reading symbols from /lib/libmp.so.2...done.
Loaded symbols for /lib/libmp.so.2
Reading symbols from
/usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
Reading symbols from /lib/libthread.so.1...done.
Loaded symbols for /lib/libthread.so.1
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_expr-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_expr-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_pap-0.9.0.so...done.
Loaded symbols for /app/experimental/free-0.9/local/lib/rlm_pap-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_chap-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_chap-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_mschap-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_mschap-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_unix-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_unix-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_eap-0.9.0.so...done.
Loaded symbols for /app/experimental/free-0.9/local/lib/rlm_eap-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_eap_md5-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_eap_md5-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_eap_leap-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_eap_leap-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_preprocess-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_preprocess-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_sql-0.9.0.so...done.
Loaded symbols for /app/experimental/free-0.9/local/lib/rlm_sql-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_sql_oracle-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_sql_oracle-0.9.0.so
Reading symbols from /oracle/ora817/lib//libclntsh.so.8.0...done.
Loaded symbols for /oracle/ora817/lib//libclntsh.so.8.0
Reading symbols from /oracle/ora817/lib//libwtc8.so...done.
Loaded symbols for /oracle/ora817/lib//libwtc8.so
Reading symbols from /lib/libsched.so.1...done.
Loaded symbols for /lib/libsched.so.1
Reading symbols from /lib/libm.so.1...done.
Loaded symbols for /lib/libm.so.1
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_realm-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_realm-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_files-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_files-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_detail-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_detail-0.9.0.so
Reading symbols from
/app/experimental/free-0.9/local/lib/rlm_radutmp-0.9.0.so...done.
Loaded symbols for
/app/experimental/free-0.9/local/lib/rlm_radutmp-0.9.0.so
Reading symbols from /lib/nss_files.so.1...done.
Loaded symbols for /lib/nss_files.so.1
#0  sql_error (sqlsocket=0x1b2ba0, config=0x1a1078) at sql_oracle.c:49
49              OCIErrorGet((dvoid *) oracle_sock->errHandle, (ub4) 1,
(text *) NULL,
(gdb) bt
#0  sql_error (sqlsocket=0x1b2ba0, config=0x1a1078) at sql_oracle.c:49
#1  0xfed630c8 in rlm_sql_accounting (instance=0x19e1f8,
request=0x203190) at rlm_sql.c:793 #2  0x0001e04c in module_post_auth ()
#3  0x0001e134 in modcall () #4  0x0001e090 in module_post_auth () #5
0x0001e1cc in modcall () #6  0x0001e090 in module_post_auth () #7
0x0001e1cc in modcall () #8  0x00018140 in rad_accounting () #9
0x00015bd8 in rad_respond () #10 0x00020178 in radius_xlat ()



My configuration looks like this:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>

Radiusd.conf

accounting {
        detail
          redundant {
                        sql2            {
                                        fail     = 1
                                        notfound = return
                                        noop     = return
                                        ok       = return
                                        updated  = return
                                        reject   = return
                                        userlock = return
                                        invalid  = return
                                        handled  = return
                                        }
                        sql2_redundant  {
                                        fail     = 1
                                        notfound = return
                                        noop     = return
                                        ok       = return
                                        updated  = return
                                        reject   = return
                                        userlock = return
                                        invalid  = return
                                        handled  = return
                                        }
                }
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>

oraclesql.conf

sql sql2 {

        driver = "rlm_sql_oracle"

        # Connect info
        server = "xxx.xxx.xxx.001"
        login = "test"
        password = "testpass"
        
        # Database table configuration
        radius_db = "oracle1"
                
          ...
      }

sql sql2_redundant {

        driver = "rlm_sql_oracle"

        # Connect info
        server = "xxx.xxx.xxx.002"
        login = "test"
        password = "testpass"
        
        # Database table configuration
        radius_db = "oracle2"
                
          ...
      }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>

The debug output before accounting DB shutdown :

rad_recv: Accounting-Request packet from host xxx.xxx.xxx.xxx:38499,
id=163, length=79 Sun Aug  3 07:12:01 2003 : Debug: Thread 1 assigned
request 0 Sun Aug  3 07:12:01 2003 : Debug: Thread 1 handling request 0,
(1 handled so far)
        User-Name = "test"
        NAS-IP-Address = xxx.xxx.xxx.xxx
        NAS-Port = 0
        NAS-Port-Type = Async
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Acct-Session-Id = "379094841"
        Acct-Status-Type = Start
        Acct-Delay-Time = 0
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group preacct
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module
"preprocess" returns noop
Sun Aug  3 07:12:01 2003 : Debug:     rlm_realm: No '@' in User-Name =
"test", looking up realm NULL
Sun Aug  3 07:12:01 2003 : Debug:     rlm_realm: No such realm "NULL"
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module "suffix"
returns noop
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module "files"
returns noop
Sun Aug  3 07:12:01 2003 : Debug: modcall: group preacct returns noop
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group accounting Sun
Aug  3 07:12:01 2003 : Debug: radius_xlat:
'/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx
/detail-20030803'
Sun Aug  3 07:12:01 2003 : Debug: rlm_detail:
/app/experimental/free-0.9/local/var/log/radius/radacct/%{Client-IP-Addr
ess}/detail-%Y%m%d expands to
/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx/
detail-20030803
Sun Aug  3 07:12:01 2003 : Debug: --- Walking the entire request list
--- Sun Aug  3 07:12:01 2003 : Debug: Threads: total/active/spare
threads = 5/1/4 Sun Aug  3 07:12:01 2003 : Debug: Waking up in 5
seconds...
Sun Aug  3 07:12:01 2003 : Debug:   modcall[accounting]: module "detail"
returns ok
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group redundant Sun
Aug  3 07:12:01 2003 : Debug: radius_xlat:  'test' Sun Aug  3 07:12:01
2003 : Debug: rlm_sql (sql2): sql_set_user escaped user --> 'test' Sun
Aug  3 07:12:01 2003 : Debug: radius_xlat:  'INSERT into RADACCT
(RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime,
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay,
AcctStopDelay) values('', '379094841', '', 'test', '',
'xxx.xxx.xxx.xxx', '0', 'Async', TO_DATE('2003-08-03
07:12:01','yyyy-mm-dd hh24:mi:ss'), '', '0', '', '', '', '0', '0', '',
'', '', 'Framed-User', 'PPP', '', '0', '0')' Sun Aug  3 07:12:01 2003 :
Debug: rlm_sql (sql2): Reserving sql socket id: 2 
Sun Aug  3 07:12:01 2003 : Debug: rlm_sql (sql2): Released sql socket
id: 2
Sun Aug  3 07:12:01 2003 : Debug:   modcall[accounting]: module "sql2"
returns ok
Sun Aug  3 07:12:01 2003 : Debug: modcall: group redundant returns ok 
Sun Aug  3 07:12:01 2003 : Debug: modcall: group accounting returns ok 
Sending Accounting-Response of id 163 to xxx.xxx.xxx.xxx:38499 
Sun Aug  3 07:12:01 2003 : Debug: Finished request 0 
Sun Aug  3 07:12:01 2003 : Debug: Going to the next request 
Sun Aug  3 07:12:01 2003 : Debug: Thread 1 waiting to be assigned a
request 
Sun Aug  3 07:12:06 2003 : Debug: --- Walking the entire request list
--- 
Sun Aug  3 07:12:06 2003 : Debug: Threads: total/active/spare threads =
5/0/5 
Sun Aug  3 07:12:06 2003 : Debug: Waking up in 1 seconds... 
Sun Aug  3 07:12:07 2003 : Debug: --- Walking the entire request list
--- 
Sun Aug  3 07:12:07 2003 : Debug: Cleaning up request 0 ID 163 with
timestamp 3f2c7d81 
Sun Aug  3 07:12:07 2003 : Debug: Nothing to do.  Sleeping until we see
a request.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>

The debug output after accounting DB shutdown:

rad_recv: Accounting-Request packet from host xxx.xxx.xxx.xxx:38501,
id=164, length=79 Sun Aug  3 07:12:30 2003 : Debug: Thread 2 assigned
request 1 Sun Aug  3 07:12:30 2003 : Debug: --- Walking the entire
request list --- Sun Aug  3 07:12:30 2003 : Debug: Threads:
total/active/spare threads = 5/1/4 Sun Aug  3 07:12:30 2003 : Debug:
Waking up in 5 seconds... Sun Aug  3 07:12:30 2003 : Debug: Thread 2
handling request 1, (1 handled so far)
        User-Name = "test"
        NAS-IP-Address = xxx.xxx.xxx.xxx
        NAS-Port = 0
        NAS-Port-Type = Async
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Acct-Session-Id = "379094841"
        Acct-Status-Type = Start
        Acct-Delay-Time = 0
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group preacct
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module
"preprocess" returns noop
Sun Aug  3 07:12:30 2003 : Debug:     rlm_realm: No '@' in User-Name =
"test", looking up realm NULL
Sun Aug  3 07:12:30 2003 : Debug:     rlm_realm: No such realm "NULL"
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module "suffix"
returns noop
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module "files"
returns noop
Sun Aug  3 07:12:30 2003 : Debug: modcall: group preacct returns noop
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group accounting Sun
Aug  3 07:12:30 2003 : Debug: radius_xlat:
'/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx
/detail-20030803'
Sun Aug  3 07:12:30 2003 : Debug: rlm_detail:
/app/experimental/free-0.9/local/var/log/radius/radacct/%{Client-IP-Addr
ess}/detail-%Y%m%d expands to
/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx/
detail-20030803
Sun Aug  3 07:12:30 2003 : Debug:   modcall[accounting]: module "detail"
returns ok
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group redundant Sun
Aug  3 07:12:30 2003 : Debug: radius_xlat:  'test' Sun Aug  3 07:12:30
2003 : Debug: rlm_sql (sql2): sql_set_user escaped user --> 'test' Sun
Aug  3 07:12:30 2003 : Debug: radius_xlat:  'INSERT into RADACCT
(RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime,
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay,
AcctStopDelay) values('', '379094841', '', 'test', '',
'xxx.xxx.xxx.xxx', '0', 'Async', TO_DATE('2003-08-03
07:12:30','yyyy-mm-dd hh24:mi:ss'), '', '0', '', '', '', '0', '0', '',
'', '', 'Framed-User', 'PPP', '', '0', '0')' Sun Aug  3 07:12:30 2003 :
Debug: rlm_sql (sql2): Reserving sql socket id: 1 Sun Aug  3 07:12:30
2003 : Error: rlm_sql_oracle: execute query failed in sql_query:
ORA-03113: end-of-file on communication channel 
Sun Aug  3 07:12:30 2003 : Debug: rlm_sql (sql2): Attempting to connect
rlm_sql_oracle #1 Sun Aug  3 07:12:30 2003 : Debug: rl_next:  returning
NULL 
Sun Aug  3 07:12:30 2003 : Debug: Waking up in 5 seconds... 
Sun Aug  3 07:12:30 2003 : Error: rlm_sql_oracle: Oracle logon failed:
'ORA-01034: ORACLE not available ORA-27101: shared memory realm does not
exist SVR4 Error: 2: No such file or directory ' Sun Aug  3 07:12:30
2003 : Error: rlm_sql (sql2): Failed to connect DB handle #1 
Sun Aug  3 07:12:30 2003 : Error: rlm_sql (sql2): reconnect failed,
database down? 
Segmentation Fault


Regards
------------------------------------------------------------------------
-------------------
Yasser Ahmed Hosny


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

Reply via email to