Bug 23505

Summary: processes die with SIGPROF, usually under heavy network load.
Product: Base System Reporter: sdrew <sdrew>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-RELEASE   
Hardware: Any   
OS: Any   

Description sdrew 2000-12-12 16:30:01 UTC
Setting up freebsd firewalls and have noticed on multiple systems that natd and other processes simply disappear. After adding signal trapping code into natd and other processes it was revealed that they are being sent signal 27 (SIGPROF) by the kernel. This happens on multiple systems and has been seen on 3.4-STABLE and 4.0 and 4.1-RELEASE (every version that I have tried).

Fix: 

I've added signal(SIGPROF,SIG_IGN) to natd, named etc and then they no longer die. This must be a kernel problem, ie kernel corruption of some sort. I have read at least one other problem report of someone having to remove the psignal(SIGPROF) in the (mp_machdep.c)/kernel to workaround this problem.
How-To-Repeat: The only way that I have found is to run a stress tool like Microsofts Web Stress tool simulating many clients web browsing through the FreeBSD firewall. After about 1 hour natd usually dies, sometimes named, sometimes syslog, etc..
Comment 1 sdrew 2001-01-01 18:04:58 UTC
Correction, it was actually kern_clock.c I modifed to prevent processes from
being killed off.

/usr/src/sys/kern >diff kern_clock.c kern_clock.c.orig
224,225c224
<                       printf("attempted to send SIGPROF to pid
%d\n",p->p_pid)
;
<                       /*psignal(p, SIGPROF); */
---
>                       psignal(p, SIGPROF);


After making this change about a week later the following hits was observed
in the syslog

/var/log/syslog.log:Dec 30 09:49:15 firewall /kernel: attempted to send
SIGPROF to pid 55305
/var/log/syslog.log:Dec 30 22:43:25 firewall /kernel: attempted to send
SIGPROF to pid 64583
/var/log/syslog.log:Dec 31 09:33:28 firewall /kernel: attempted to send
SIGPROF to pid 50306

Like I mentioned I have seen this bug on at least 4 different freebsd
machines.

There must be other people also having this problem and just not knowing why
they have processes disappearing. It is very intermittent, in my case it
took over a week and then I got these 3 hits.

Steve Drew.
Comment 2 iedowse freebsd_committer freebsd_triage 2001-11-18 16:49:51 UTC
State Changed
From-To: open->closed


This is almost certainly the result of a per-process kernel stack 
overflow. The size of this stack was increased recently, so updating 
to a recent stable should solve to problem.
Comment 3 Steve.Drew 2002-01-15 17:49:35 UTC
FYI,
 
Even with the UPAGES=2 on 4.5-PRE-RELEASE this problem still ocurrs.
Although maybe only once or twice per week.
 
I have modified kern_clock.c to record whenever it sends a SIGPROF, and
it's sent a couple over a week, killing off the processes (nat, snort).
 
Steve.