From owner-freebsd-threads@FreeBSD.ORG Mon Sep 27 07:00:11 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5413A16A4D1 for ; Mon, 27 Sep 2004 07:00:11 +0000 (GMT) Received: from transport.cksoft.de (transport.cksoft.de [62.111.66.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9313843D46 for ; Mon, 27 Sep 2004 07:00:10 +0000 (GMT) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from transport.cksoft.de (localhost [127.0.0.1]) by transport.cksoft.de (Postfix) with ESMTP id AE5AA1FF9A8 for ; Mon, 27 Sep 2004 09:00:07 +0200 (CEST) Received: by transport.cksoft.de (Postfix, from userid 66) id 9F4511FF9A7; Mon, 27 Sep 2004 09:00:05 +0200 (CEST) Received: by mail.int.zabbadoz.net (Postfix, from userid 1060) id C7CD915682; Mon, 27 Sep 2004 06:59:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.int.zabbadoz.net (Postfix) with ESMTP id BD249154FC for ; Mon, 27 Sep 2004 06:59:49 +0000 (UTC) Date: Mon, 27 Sep 2004 06:59:49 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@e0-0.zab2.int.zabbadoz.net To: freebsd-threads@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS cksoft-s20020300-20031204bz on transport.cksoft.de Subject: bt: kse_thr_interrupt,sig_daemon,kse_sched_single,?? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2004 07:00:11 -0000 Hi, after updating to newer RELENG_5 from yesterday I get a core of a userspace utility with the following bt: #0 0x280c8e4f in kse_thr_interrupt () at kse_thr_interrupt.S:2 2 RSYSCALL(kse_thr_interrupt) (gdb) bt full #0 0x280c8e4f in kse_thr_interrupt () at kse_thr_interrupt.S:2 No locals. #1 0x280b8104 in sig_daemon (arg=0x0) at RELENG_5/compile-20040926-1415/lib/libpthread/thread/thr_sig.c:216 i = 129 ts = {tv_sec = 30, tv_nsec = 0} set = {__bits = {0, 0, 0, 0}} curkse = (struct kse *) 0x80c4100 #2 0x280c1363 in kse_sched_single (kmbx=0x17f) at RELENG_5/compile-20040926-1415/lib/libpthread/thread/thr_kern.c:895 curkse = (struct kse *) 0x80c4100 curthread = (struct pthread *) 0x80ca200 ts = {tv_sec = 0, tv_nsec = 0} sigmask = {__bits = {0, 0, 0, 0}} i = 135045120 sigseqno = 0 level = 383 first = 1 #3 0x00000000 in ?? () No symbol table info available. -- Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT From owner-freebsd-threads@FreeBSD.ORG Mon Sep 27 07:45:12 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5FD916A4CE; Mon, 27 Sep 2004 07:45:12 +0000 (GMT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF38C43D49; Mon, 27 Sep 2004 07:45:11 +0000 (GMT) (envelope-from bel@orel.ru) Received: from orel.ru (lg.orel.ru [62.33.11.59]) by tts.orel.ru (8.12.10/8.12.10/bel) with ESMTP id i8R7iwBm022249; Mon, 27 Sep 2004 11:45:04 +0400 Message-ID: <4157C4FA.2010409@orel.ru> Date: Mon, 27 Sep 2004 11:44:58 +0400 From: Andrew Belashov Organization: ORIS User-Agent: Mozilla/5.0 (X11; U; FreeBSD sparc64; en-US; rv:1.6) Gecko/20040407 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Mike Makonnen References: <4152BECE.5080202@orel.ru> <20040923150857.GA51350@rogue.acs.lan> In-Reply-To: <20040923150857.GA51350@rogue.acs.lan> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Zombi-Check: on netra2.orel.ru cc: freebsd-sparc64@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Bug in kse_switchin()? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2004 07:45:12 -0000 Mike Makonnen wrote: > On Thu, Sep 23, 2004 at 04:17:18PM +0400, Andrew Belashov wrote: > >>Daniel Eischen wrote: >> >>>Wouldn't you also see same behavior (bugs) in other things, like >>>getcontext(), setcontext(), and swapcontext() (kern_context.c)? >> >>No. uap structure is not used after set_mcontext(). > > > So, the attached change to thr_create should work as far as > libthr is concerned then? > > BTW, have you tried libthr on sparc64, and if so how does it work? Simple program (Like "Hello, World!") work with libthr. But Mozilla/Firefox does not work. Firefox will start. Drop down menus and hot buttons work. Pages don't open. Process firefox-bin is non-killable (kill -9 has no effect!!!). -- With best regards, Andrew Belashov. From owner-freebsd-threads@FreeBSD.ORG Mon Sep 27 11:02:07 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C89E16A4CE for ; Mon, 27 Sep 2004 11:02:07 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26BC943D31 for ; Mon, 27 Sep 2004 11:02:07 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8RB27t7014845 for ; Mon, 27 Sep 2004 11:02:07 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8RB26Lr014837 for freebsd-threads@freebsd.org; Mon, 27 Sep 2004 11:02:06 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 27 Sep 2004 11:02:06 GMT Message-Id: <200409271102.i8RB26Lr014837@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2004 11:02:07 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2004/04/22] threads/65883threads libkse's sigwait does not work after fork 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] kern/20861 threads libc_r does not honor socket timeouts o [2001/01/20] threads/24472threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] threads/24632threads libc_r delicate deviation from libc in ha o [2001/01/25] kern/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] threads/34536threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] threads/39922threads [PATCH?] Threaded applications executed w o [2002/08/04] kern/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] threads/48856threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] threads/49087threads Signals lost in programs linked with libc o [2003/05/08] threads/51949threads thread in accept cannot be cancelled s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when o [2004/09/14] threads/71725threads Mysql Crashes frequently giving Sock Erro 16 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/26] kern/18824 threads gethostbyname is not thread safe o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2000/10/21] kern/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] threads/30464threads pthread mutex attributes -- pshared o [2002/05/02] threads/37676threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] threads/40671threads pthread_cancel doesn't remove thread from o [2004/07/13] threads/69020threads pthreads library leaks _gc_mutex o [2004/09/21] threads/71966threads Mlnet Core Dumped : Fatal error '_pq_inse 8 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Sep 27 22:59:22 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A721316A4CE for ; Mon, 27 Sep 2004 22:59:22 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E7F343D4C for ; Mon, 27 Sep 2004 22:59:22 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 731787A425; Mon, 27 Sep 2004 15:59:22 -0700 (PDT) Message-ID: <41589B4A.9080508@elischer.org> Date: Mon, 27 Sep 2004 15:59:22 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Andrew Gallatin References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> In-Reply-To: <16728.37731.540143.307772@grasshopper.cs.duke.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2004 22:59:22 -0000 Andrew Gallatin wrote: >I've put together a quick and dirty example of the thread >deadlock-on-exit (sometimes lingering thread) problem I've been >seeing with my driver and FreeBSD threads. See the long "Re: >Unkillable KSE threaded proc" thread from earlier this month for >details. > >The tarball linked below is based on /usr/share/examples/kld/cdev >To reproduce the problem, build the module and load it. >Then build testcdev, and run it. > >Install the skill-4.1.1 port. Then ssh in from another host, and do 'skill >-9 -u $USER'. > >This should leave you with a stuck thread.. > hmm looks like the problem is that the condition variable respods to a masked signal the signals are all masked from the perspective of the thread..the signal is delivered to the signal catcher thread so the UTS can handle it but in the meanwhile the thread has done a RESTART.. David: check out what happens when a signal is delivered to a worker thread that is in a cv_wait_signal() > >> . >> > > I haven't checked it as yet but I am starting to see some hint of some > problem.. > The fact that cv_wait_signal() reacts to a blocked signal surproses me.. > (according to teh man page) > >http://people.freebsd.org/~gallatin/threadlock.tgz > > >I would really love for somebody to look at it before 5.3-R... > >Thank you, > > >Drew > > From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 13:23:48 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0372016A4CE for ; Wed, 29 Sep 2004 13:23:48 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBF4A43D46; Wed, 29 Sep 2004 13:23:47 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) i8TDNk0R059192; Wed, 29 Sep 2004 13:23:47 GMT (envelope-from davidxu@freebsd.org) Message-ID: <415AB791.10809@freebsd.org> Date: Wed, 29 Sep 2004 21:24:33 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.1) Gecko/20040730 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> In-Reply-To: <41589B4A.9080508@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Andrew Gallatin cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 13:23:48 -0000 Julian Elischer wrote: > > hmm looks like the problem is that the condition variable respods to a > masked signal > > > the signals are all masked from the perspective of the thread..the > signal is delivered to the signal > catcher thread so the UTS can handle it but in the meanwhile the > thread has done a RESTART.. > > David: check out what happens when a signal is delivered to a worker > thread that is in a cv_wait_signal() > Please tell me easiest way to reproduce it, I tried best to reproduce it, but still got nothing. >> >>> . >>> >> >> I haven't checked it as yet but I am starting to see some hint of >> some problem.. >> The fact that cv_wait_signal() reacts to a blocked signal surproses >> me.. >> (according to teh man page) >> >> http://people.freebsd.org/~gallatin/threadlock.tgz >> I use this test case. From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 13:52:11 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86F6016A4CE; Wed, 29 Sep 2004 13:52:11 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24DFB43D48; Wed, 29 Sep 2004 13:52:11 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8TDq7Jt006664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Sep 2004 09:52:07 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8TDq2HI004772; Wed, 29 Sep 2004 09:52:02 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16730.48642.4481.841374@grasshopper.cs.duke.edu> Date: Wed, 29 Sep 2004 09:52:02 -0400 (EDT) To: David Xu In-Reply-To: <415AB791.10809@freebsd.org> References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 13:52:11 -0000 David Xu writes: > Please tell me easiest way to reproduce it, I tried best to reproduce > it, but still got nothing. > > >> http://people.freebsd.org/~gallatin/threadlock.tgz > >> > I use this test case. Are you on an SMP? Do you use an 'ssh $HOST skill -u $USER -9' to send the signal? Julian, you can reproduce it, right? Drew From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 19:58:32 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D08DD16A4D0; Wed, 29 Sep 2004 19:58:32 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EC7643D4C; Wed, 29 Sep 2004 19:58:32 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 854927A446; Wed, 29 Sep 2004 12:58:32 -0700 (PDT) Message-ID: <415B13E8.2090205@elischer.org> Date: Wed, 29 Sep 2004 12:58:32 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Andrew Gallatin References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> In-Reply-To: <16730.48642.4481.841374@grasshopper.cs.duke.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 19:58:32 -0000 Andrew Gallatin wrote: >David Xu writes: > > > Please tell me easiest way to reproduce it, I tried best to reproduce > > it, but still got nothing. > > > > >> http://people.freebsd.org/~gallatin/threadlock.tgz > > >> > > I use this test case. > >Are you on an SMP? Do you use an 'ssh $HOST skill -u $USER -9' to >send the signal? > >Julian, you can reproduce it, right? > not yet.. am setting up a SMP test machine to try again.. > >Drew > > > >_______________________________________________ >freebsd-threads@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-threads >To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 20:13:55 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3371016A4CE; Wed, 29 Sep 2004 20:13:55 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8B5743D5F; Wed, 29 Sep 2004 20:13:54 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8TKDpJt008651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Sep 2004 16:13:51 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8TKDk9Z005066; Wed, 29 Sep 2004 16:13:46 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16731.6010.446877.347190@grasshopper.cs.duke.edu> Date: Wed, 29 Sep 2004 16:13:46 -0400 (EDT) To: Julian Elischer In-Reply-To: <415B13E8.2090205@elischer.org> References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 20:13:55 -0000 Julian Elischer writes: > > > Andrew Gallatin wrote: > > >David Xu writes: > > > > > Please tell me easiest way to reproduce it, I tried best to reproduce > > > it, but still got nothing. > > > > > > >> http://people.freebsd.org/~gallatin/threadlock.tgz > > > >> > > > I use this test case. > > > >Are you on an SMP? Do you use an 'ssh $HOST skill -u $USER -9' to > >send the signal? > > > >Julian, you can reproduce it, right? > > > > not yet.. > > am setting up a SMP test machine to try again.. So far I've only had a chance to test under RELENG_5. Maybe some change you made recently fixed it.. Drew From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 20:45:11 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8098A16A4CE; Wed, 29 Sep 2004 20:45:11 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67B5B43D3F; Wed, 29 Sep 2004 20:45:11 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 477AF7A446; Wed, 29 Sep 2004 13:45:11 -0700 (PDT) Message-ID: <415B1ED6.8010809@elischer.org> Date: Wed, 29 Sep 2004 13:45:10 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Andrew Gallatin References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> <16731.6010.446877.347190@grasshopper.cs.duke.edu> In-Reply-To: <16731.6010.446877.347190@grasshopper.cs.duke.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 20:45:11 -0000 Andrew Gallatin wrote: >Julian Elischer writes: > > > > > > Andrew Gallatin wrote: > > > > >David Xu writes: > > > > > > > Please tell me easiest way to reproduce it, I tried best to reproduce > > > > it, but still got nothing. > > > > > > > > >> http://people.freebsd.org/~gallatin/threadlock.tgz > > > > >> > > > > I use this test case. > > > > > >Are you on an SMP? Do you use an 'ssh $HOST skill -u $USER -9' to > > >send the signal? > > > > > >Julian, you can reproduce it, right? > > > > > > > not yet.. > > > > am setting up a SMP test machine to try again.. > >So far I've only had a chance to test under RELENG_5. >Maybe some change you made recently fixed it.. > >Drew > while you are about it.. try this: diff -u -r1.199 kern_thread.c --- kern/kern_thread.c 25 Sep 2004 00:53:46 -0000 1.199 +++ kern/kern_thread.c 29 Sep 2004 19:45:56 -0000 @@ -282,13 +282,13 @@ * Initialize type-stable parts of a ksegrp (when newly created). */ static int -ksegrp_init(void *mem, int size, int flags) +ksegrp_ctor(void *mem, int size, int flags) { struct ksegrp *kg; kg = (struct ksegrp *)mem; + bzero(mem, size); kg->kg_sched = (struct kg_sched *)&kg[1]; - /* sched_newksegrp(kg); */ return (0); } @@ -369,7 +369,7 @@ tid_zone = uma_zcreate("TID", sizeof(struct tid_bitmap_part), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); ksegrp_zone = uma_zcreate("KSEGRP", sched_sizeof_ksegrp(), - NULL, NULL, ksegrp_init, NULL, + ksegrp_ctor, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); kseinit(); /* set up kse specific stuff e.g. upcall zone*/ } From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 21:13:17 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0484516A4CE; Wed, 29 Sep 2004 21:13:17 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id A96F043D2D; Wed, 29 Sep 2004 21:13:16 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8TLDEJt016491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Sep 2004 17:13:14 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8TLD8iC005114; Wed, 29 Sep 2004 17:13:08 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16731.9572.915356.122446@grasshopper.cs.duke.edu> Date: Wed, 29 Sep 2004 17:13:08 -0400 (EDT) To: Julian Elischer In-Reply-To: <415B1ED6.8010809@elischer.org> References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> <16731.6010.446877.347190@grasshopper.cs.duke.edu> <415B1ED6.8010809@elischer.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 21:13:17 -0000 Julian Elischer writes: > > while you are about it.. try this: No change for me.. > diff -u -r1.199 kern_thread.c > --- kern/kern_thread.c 25 Sep 2004 00:53:46 -0000 1.199 > +++ kern/kern_thread.c 29 Sep 2004 19:45:56 -0000 > @@ -282,13 +282,13 @@ > * Initialize type-stable parts of a ksegrp (when newly created). > */ > static int > -ksegrp_init(void *mem, int size, int flags) > +ksegrp_ctor(void *mem, int size, int flags) It actually needs a *arg to be a valid ctor.. -ksegrp_init(void *mem, int size, int flags) +ksegrp_ctor(void *mem, int size, void *arg, int flags) I'm cvsupping to HEAD right now to see if I can still reproduce it. Drew From owner-freebsd-threads@FreeBSD.ORG Wed Sep 29 21:45:40 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CF5116A4CE; Wed, 29 Sep 2004 21:45:40 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B934143D45; Wed, 29 Sep 2004 21:45:39 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8TLjaJt021317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Sep 2004 17:45:36 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8TLjVGD005140; Wed, 29 Sep 2004 17:45:31 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16731.11515.504636.53058@grasshopper.cs.duke.edu> Date: Wed, 29 Sep 2004 17:45:31 -0400 (EDT) To: Julian Elischer In-Reply-To: <415B1ED6.8010809@elischer.org> References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> <16731.6010.446877.347190@grasshopper.cs.duke.edu> <415B1ED6.8010809@elischer.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 21:45:40 -0000 I tried a -current kernel (w/o your patch) from today (still RELENG_5 userland), and I still see the problem. % ssh scream 'skill -9 -u gallatin' Connection to scream closed by remote host. % ssh scream 'ssh scream 'ps axH | grep testc' 580 ?? SLs 0:00.01 csh -c ps axH | grep testc 586 ?? RL 0:00.00 grep testc 535 p0- WL 0:06.21 ./testcdev On scream's console, send break to debugger..: Stopped at kdb_enter+0x30: leave db> ps pid proc uarea uid ppid pgrp flag stat wmesg wchan cmd 548 c1a39c40 e67ee000 1387 547 548 0004002 [SLPQ ttyin 0xc1830c10][SLP] csh 547 c1a39a80 e67ed000 1387 545 545 0000100 [SLPQ select 0xc071aaa4][SLP] sshd 545 c1817000 e5556000 0 450 545 0000100 [SLPQ sbwait 0xc1991320][SLP] sshd 535 c1a34e00 e67e6000 1387 1 535 020c482 (threaded) testcdev thread 0xc164dc80 ksegrp 0xc15e57e0 [SUSP] 511 c1a34a80 e67e4000 0 1 511 0004002 [SLPQ ttyin 0xc1705810][SLP] getty db> trace 535 sched_switch(c164dc80,c164daf0,1,4ec51334,ed18649a) at sched_switch+0x137 mi_switch(1,c164daf0,0,0,0) at mi_switch+0x1d4 thread_single(1,c164dc80,0,0,0) at thread_single+0x1d7 exit1(c164dc80,9,0,0,c051996e) at exit1+0x115 expand_name(c164dc80,9,100,0,0) at expand_name postsig(9,c164dc80,0,0,0) at postsig+0x204 ast(e52d1d48) at ast+0x5e4 doreti_ast() at doreti_ast+0x17 db> c It seems to be just a problem with skill -9. skill -2 works fine. As I said before, libthr seems to behave differently. Rather than a lingering thread, the polling thread (doing the while(1)) is stuck on the CPU (using 100% of one cpu in a dual system), and the thread which was doing the cv_wait() is stuck with the exact same stack as above: 629 c1a1da80 e67e7000 1387 1 629 0004482 (threaded) testcdev thread 0xc164dc80 ksegrp 0xc15e54d0 [SUSP] thread 0xc1879af0 ksegrp 0xc15e54d0 [CPU 1] db> trace 629 sched_switch(c164dc80,0,1,b5d71f28,b4e1d6c8) at sched_switch+0x137 mi_switch(1,0,c1870880,c164dc80,c164dc80) at mi_switch+0x1d4 thread_single(1,c164dc80,e52d1c54,c1b14100,c164dc80) at thread_single+0x1d7 exit1(c164dc80,9,0,e52d1ce4,c051996e) at exit1+0x115 expand_name(c164dc80,9,100,0,0) at expand_name postsig(9,246,c06e7bd0,36,bfafefb4) at postsig+0x1a4 ast(e52d1d48) at ast+0x5e4 doreti_ast() at doreti_ast+0x17 db> c Drew From owner-freebsd-threads@FreeBSD.ORG Fri Oct 1 03:21:46 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 96C9216A4CE for ; Fri, 1 Oct 2004 03:21:46 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57C2543D4C; Fri, 1 Oct 2004 03:21:46 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) i913LfJd058618; Fri, 1 Oct 2004 03:21:42 GMT (envelope-from davidxu@freebsd.org) Message-ID: <415CCD79.3030401@freebsd.org> Date: Fri, 01 Oct 2004 11:22:33 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.1) Gecko/20040730 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Gallatin References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> <16731.6010.446877.347190@grasshopper.cs.duke.edu> <415B1ED6.8010809@elischer.org> <16731.11515.504636.53058@grasshopper.cs.duke.edu> In-Reply-To: <16731.11515.504636.53058@grasshopper.cs.duke.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Julian Elischer cc: freebsd-threads@freebsd.org Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2004 03:21:46 -0000 Now, I can reproduce it on SMP. However, if I : sysctl -w kern.smp.forward_signal_enabled=0 then, I can always kill it. it sounds like another IPI bug. David Xu Andrew Gallatin wrote: >I tried a -current kernel (w/o your patch) from today (still RELENG_5 >userland), and I still see the problem. > >% ssh scream 'skill -9 -u gallatin' >Connection to scream closed by remote host. > >% ssh scream 'ssh scream 'ps axH | grep testc' > 580 ?? SLs 0:00.01 csh -c ps axH | grep testc > 586 ?? RL 0:00.00 grep testc > 535 p0- WL 0:06.21 ./testcdev > >On scream's console, send break to debugger..: >Stopped at kdb_enter+0x30: leave >db> ps > pid proc uarea uid ppid pgrp flag stat wmesg wchan cmd > 548 c1a39c40 e67ee000 1387 547 548 0004002 [SLPQ ttyin 0xc1830c10][SLP] csh > 547 c1a39a80 e67ed000 1387 545 545 0000100 [SLPQ select 0xc071aaa4][SLP] sshd > 545 c1817000 e5556000 0 450 545 0000100 [SLPQ sbwait 0xc1991320][SLP] sshd > 535 c1a34e00 e67e6000 1387 1 535 020c482 (threaded) testcdev > thread 0xc164dc80 ksegrp 0xc15e57e0 [SUSP] > 511 c1a34a80 e67e4000 0 1 511 0004002 [SLPQ ttyin 0xc1705810][SLP] getty > >db> trace 535 >sched_switch(c164dc80,c164daf0,1,4ec51334,ed18649a) at sched_switch+0x137 >mi_switch(1,c164daf0,0,0,0) at mi_switch+0x1d4 >thread_single(1,c164dc80,0,0,0) at thread_single+0x1d7 >exit1(c164dc80,9,0,0,c051996e) at exit1+0x115 >expand_name(c164dc80,9,100,0,0) at expand_name >postsig(9,c164dc80,0,0,0) at postsig+0x204 >ast(e52d1d48) at ast+0x5e4 >doreti_ast() at doreti_ast+0x17 >db> c > > >It seems to be just a problem with skill -9. skill -2 works fine. > >As I said before, libthr seems to behave differently. Rather than a >lingering thread, the polling thread (doing the while(1)) is stuck on >the CPU (using 100% of one cpu in a dual system), and the thread which >was doing the cv_wait() is stuck with the exact same stack as above: > > 629 c1a1da80 e67e7000 1387 1 629 0004482 (threaded) testcdev > thread 0xc164dc80 ksegrp 0xc15e54d0 [SUSP] > thread 0xc1879af0 ksegrp 0xc15e54d0 [CPU 1] > >db> trace 629 >sched_switch(c164dc80,0,1,b5d71f28,b4e1d6c8) at sched_switch+0x137 >mi_switch(1,0,c1870880,c164dc80,c164dc80) at mi_switch+0x1d4 >thread_single(1,c164dc80,e52d1c54,c1b14100,c164dc80) at thread_single+0x1d7 >exit1(c164dc80,9,0,e52d1ce4,c051996e) at exit1+0x115 >expand_name(c164dc80,9,100,0,0) at expand_name >postsig(9,246,c06e7bd0,36,bfafefb4) at postsig+0x1a4 >ast(e52d1d48) at ast+0x5e4 >doreti_ast() at doreti_ast+0x17 >db> c > > >Drew > > > > From owner-freebsd-threads@FreeBSD.ORG Fri Oct 1 19:27:23 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD1BB16A4CF; Fri, 1 Oct 2004 19:27:23 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 749F143D53; Fri, 1 Oct 2004 19:27:23 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i91JR1Jt029203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Oct 2004 15:27:01 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i91JQsv7007972; Fri, 1 Oct 2004 15:26:54 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16733.44926.348617.722562@grasshopper.cs.duke.edu> Date: Fri, 1 Oct 2004 15:26:54 -0400 (EDT) To: David Xu In-Reply-To: <415CCD79.3030401@freebsd.org> References: <16728.37731.540143.307772@grasshopper.cs.duke.edu> <41589B4A.9080508@elischer.org> <415AB791.10809@freebsd.org> <16730.48642.4481.841374@grasshopper.cs.duke.edu> <415B13E8.2090205@elischer.org> <16731.6010.446877.347190@grasshopper.cs.duke.edu> <415B1ED6.8010809@elischer.org> <16731.11515.504636.53058@grasshopper.cs.duke.edu> <415CCD79.3030401@freebsd.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-threads@freebsd.org cc: Andrew Gallatin cc: Julian Elischer Subject: Re: easy to reproduce unkillable threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2004 19:27:24 -0000 David Xu writes: > Now, I can reproduce it on SMP. However, if I : Hurray! I'm not crazy! > sysctl -w kern.smp.forward_signal_enabled=0 > then, I can always kill it. it sounds like another IPI bug. > I thought the IPI bugs were IPIs getting stuck. But this IPI was delivered. Naively, I would say that it seems more like an MP-safety issue in the kernel thread exit code.. Drew