Debian + Exec-Program = Zombie process
Hello, I am using Debian GNU/Linux 3.1, libc6 2.3.2.ds1-22. I have compiled freeradius 0.93, 1.0.1, 1.0.5, 1.1.0 in turn with the following options: ./configure --prefix=/usr/local/freeradius --without-threads compilation/installation went fine, radius started up fine. /usr/local/freeradius/etc/raddb/acct_users content: DEFAULT Acct-Status-Type == Stop Exec-Program = "/usr/local/bin/test.pl" /usr/local/bin/test.pl content: #-------------------------------------- #!/usr/bin/perl exit(0); #-------------------------------------- as soon as I send accounting stop packet to radius, test.pl executes and becomes a zombie. (I tried bash script, c program with the same result.) 3890 ? Ss 0:00 /usr/local/freeradius/sbin/radiusd 3893 ? Z 0:00 \_ [test.pl] <defunct> As far as I know, this should have been fixed in 1.0.3 and I doubt it's debian specific, as I know 0.93 works on another RH 7.3 without a problem (In fact zombie is listed there as well but disappears after several seconds). Any ideas/suggestions? Thanks in advance, George
George Chelidze <wrath@geo.net.ge> writes:
as soon as I send accounting stop packet to radius, test.pl executes and becomes a zombie. (I tried bash script, c program with the same result.)
3890 ? Ss 0:00 /usr/local/freeradius/sbin/radiusd 3893 ? Z 0:00 \_ [test.pl] <defunct>
As far as I know, this should have been fixed in 1.0.3 and I doubt it's debian specific, as I know 0.93 works on another RH 7.3 without a problem (In fact zombie is listed there as well but disappears after several seconds).
Any ideas/suggestions?
Is it replaced by a new zombie the next time you send an accounting packet, or do the zombies add up? The way I read rad_fork(), it will call reap_children() every time it is called. But there's not necessarily anything calling reap_children() inbetween. This means that zombies will only live forever on servers without traffic. You should probably read the comment in front of reap_children() in src/main/threads.c. I believe it explains why this design was chosen. Bjørn
Bjørn Mork wrote:
George Chelidze <wrath@geo.net.ge> writes:
as soon as I send accounting stop packet to radius, test.pl executes and becomes a zombie. (I tried bash script, c program with the same result.)
3890 ? Ss 0:00 /usr/local/freeradius/sbin/radiusd 3893 ? Z 0:00 \_ [test.pl] <defunct>
As far as I know, this should have been fixed in 1.0.3 and I doubt it's debian specific, as I know 0.93 works on another RH 7.3 without a problem (In fact zombie is listed there as well but disappears after several seconds).
Any ideas/suggestions?
Is it replaced by a new zombie the next time you send an accounting packet, or do the zombies add up?
Zombies add up even when I recompile without --without-threads option.
The way I read rad_fork(), it will call reap_children() every time it is called. But there's not necessarily anything calling reap_children() inbetween. This means that zombies will only live forever on servers without traffic.
You should probably read the comment in front of reap_children() in src/main/threads.c. I believe it explains why this design was chosen.
If I understood things correctly, if I compile radius without threads support reap_children() won't be called and zombies will add up? I am not against compiling it with threads support, but unfortunately I get something like this: 18439 ? Ss 0:00 /usr/local/freeradius/sbin/radiusd 18440 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18441 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18460 ? Z 0:00 | \_ [test.pl] <defunct> 18492 ? Z 0:00 | \_ [test.pl] <defunct> 18442 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18480 ? Z 0:00 | \_ [test.pl] <defunct> 18443 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18483 ? Z 0:00 | \_ [test.pl] <defunct> 18444 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18486 ? Z 0:00 | \_ [test.pl] <defunct> 18445 ? S 0:00 \_ /usr/local/freeradius/sbin/radiusd 18489 ? Z 0:00 \_ [test.pl] <defunct>
Bjørn
Thanks a lot for your reply
George Chelidze <wrath@geo.net.ge> wrote:
Zombies add up even when I recompile without --without-threads option.
That sounds like a serious problem. Looking at the source, I don't see why, though.
If I understood things correctly, if I compile radius without threads support reap_children() won't be called and zombies will add up?
No. See radiusd.c, look for waitpid(). That code reaps the zombies when there are no threads. Alan DeKok.
Alan DeKok wrote:
George Chelidze <wrath@geo.net.ge> wrote:
Zombies add up even when I recompile without --without-threads option.
That sounds like a serious problem. Looking at the source, I don't see why, though.
If I understood things correctly, if I compile radius without threads support reap_children() won't be called and zombies will add up?
No. See radiusd.c, look for waitpid(). That code reaps the zombies when there are no threads.
I have checked the source, waitpid() is really there but I don't understand why zombies add up when 1.0.1 is compiled without threads. I found a solution (compiled 1.0.1 with --with-threads option) and it works for me, but I'd like to help freeradius team (if I can) to find the reason why it's broken (at least in my environment) in newer versions. Can I make some tests to narrow down the problem, or some other actions. Best Regards, George
George Chelidze wrote:
versions. Can I make some tests to narrow down the problem, or some other actions.
Best Regards,
George
I suppose you could add some debug code to where you believe the calls to waitpid should be/are The way I read it, without threads it should be in src/main/radiusd.c:631 in cvs 20060124 Joe
participants (4)
-
Alan DeKok -
Bjørn Mork -
George Chelidze -
Joe Maimon