Hi, all!
I have installed freeradius-0.5 under FreeBSD-4.3.
On each accounting Stop packet my script starts:
DEFAULT Acct-Status-Type == "Stop", h323-call-type == "h323-call-type=VoIP"
        Exec-Program-Wait = /path_to/acc.pl

It works fine and always return 0.
But sometime radiusd hangs up (ate all processor time). Using gdb I have found that
it call waitpid() mutiple time. waitpid is only at 3 places - exec.c:311,
radiusd.c and session.c. Radiusd hangs up when waitpid at exec.c:311 return -1
(no child pid) instead of pid:
    while(waitpid(pid, &status, 0) != pid)
            ;
This occure when that pid was already "waited" in another place. I have add
debug to this three place. Usually, it output is like this:
Fri Jun  7 16:01:46 2002 : Info: exec.c: waitpid returned 98369; pid=98369; status=0
Fri Jun  7 16:01:46 2002 : Info: radiusd.c: waitpid returned 0; pid=-1; status=2

and, when it hang, like this:
Fri Jun  7 16:01:46 2002 : Info: radiusd.c: waitpid returned 98370; pid=-1; status=0
Fri Jun  7 16:01:46 2002 : Info: radiusd.c: waitpid returned -1; pid=-1; status=0
Fri Jun  7 16:01:46 2002 : Info: exec.c: waitpid returned -1; pid=98370; 
status=-1079276884: No child processes
Fri Jun  7 16:01:46 2002 : Info: radiusd.c: waitpid returned -1; pid=-1; status=0
Fri Jun  7 16:01:46 2002 : Error: Exec-Program: Abnormal child exit (killed or 
coredump)
Fri Jun  7 16:01:49 2002 : Error: Dropping duplicate authentication packet from client 
localhost:4946 - ID: 61

So, waitpid() at radiusd.c in abnormal case called earlier, then in exec.c.
Of course, I could remove while and left one waitpid() call, but than radiusd
hang in _thread_sys_poll() syscall

I presume that it caused by threaded architecture of freeradius, but don't know this
architecture good enough, so can't find real reason.

Also, if radiusd running with -X flag, it never hang up.
Probably, somebody know what cause radiusd hangup or tell me how I should get
additional debug information?

            
            
-- 
Denis Tatarskikh [UdSU/MF] [UdSU/IC]        mailto:[EMAIL PROTECTED]



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

Reply via email to