From owner-freebsd-stable@FreeBSD.ORG Fri Oct 22 20:35:28 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB64A16A4CE for ; Fri, 22 Oct 2004 20:35:28 +0000 (GMT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBAAA43D1F for ; Fri, 22 Oct 2004 20:35:27 +0000 (GMT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id i9MKZQis041271 for ; Sat, 23 Oct 2004 00:35:26 +0400 (MSD) (envelope-from is@rambler-co.ru) Date: Sat, 23 Oct 2004 00:35:26 +0400 (MSD) From: Igor Sysoev X-X-Sender: is@is.park.rambler.ru To: freebsd-stable@freebsd.org Message-ID: <20041023003246.Y91215@is.park.rambler.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: panic caused by EVFILT_SIGNAL detaching in rfork()ed thread X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Oct 2004 20:35:28 -0000 Here is more correct patch to fix the panic in 4.x reported in http://freebsd.rambler.ru/bsdmail/freebsd-hackers_2004/msg02732.html ------------------------- --- src/sys/kern/kern_event.c Sun Oct 10 12:17:55 2004 +++ src/sys/kern/kern_event.c Sun Oct 10 12:19:29 2004 @@ -794,7 +794,8 @@ while (kn != NULL) { kn0 = SLIST_NEXT(kn, kn_link); if (kq == kn->kn_kq) { - kn->kn_fop->f_detach(kn); + if (!(kn->kn_status & KN_DETACHED)) + kn->kn_fop->f_detach(kn); /* XXX non-fd release of kn->kn_ptr */ knote_free(kn); *knp = kn0; ------------------------- The patch based on the fix for FreeBSD 5.x: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/kern_event.c.diff?r1=1.79&r2=1.80 For more information see the thread started in http://freebsd.rambler.ru/bsdmail/freebsd-current_2004/msg18389.html To reproduce the panic in 4.x you could download http://sysoev.ru/nginx/nginx-0.1.2.tar.gz and build it without the installation: tar zxf nginx-0.1.2.tar.gz cd nginx-0.1.2 ./configure --with-threads=rfork \ --without-http_rewrite_module \ --prefix=$PWD \ --pid-path=nginx.pid \ --http-log-path=access.log \ --error-log-path=stderr make Now you have to edit ./conf/nginx.conf. Add the line "daemon off;" in the start of the file. Change the lines "worker_processes 3;" to "worker_threads 3;" and "listen 80;" to "listen 8000;". Now you could run ./nginx as non-privileged user. If you run in another console ps ax -o pid,ppid,%cpu,vsz,wchan,command|egrep '(nginx:|PID)' you will see something like this: PID PPID %CPU VSZ WCHAN COMMAND 3737 238 0.0 1340 pause nginx: master process ./nginx 3738 3737 0.0 1844 kqread nginx: worker process (nginx) 3739 3738 0.0 1844 kqread nginx: worker thread (nginx) 3740 3738 0.0 1844 kqread nginx: worker thread (nginx) 3741 3738 0.0 1844 kqread nginx: worker thread (nginx) Now stop nginx by pressing ^C. Your system may panic. Igor Sysoev http://sysoev.ru/en/