From owner-freebsd-threads@FreeBSD.ORG Mon Jun 23 11:07:03 2008 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C182106567E for ; Mon, 23 Jun 2008 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5A99D8FC3B for ; Mon, 23 Jun 2008 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5NB73FK065126 for ; Mon, 23 Jun 2008 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5NB72wJ065122 for freebsd-threads@FreeBSD.org; Mon, 23 Jun 2008 11:07:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Jun 2008 11:07:02 GMT Message-Id: <200806231107.m5NB72wJ065122@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2008 11:07:03 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for -lc_r 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread(3) dont dequeue signals s threa/34536 threads accept() blocks other threads s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r o threa/70975 threads [sysvipc] unexpected and unreliable behaviour when usi o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/118715 threads kse problem o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 23 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/122923 threads 'nice' does not prevent background process from steali 11 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue Jun 24 07:12:47 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD8B106568D for ; Tue, 24 Jun 2008 07:12:47 +0000 (UTC) (envelope-from saikothapalli@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8CF8FC1C for ; Tue, 24 Jun 2008 07:12:47 +0000 (UTC) (envelope-from saikothapalli@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so9931782rvf.43 for ; Tue, 24 Jun 2008 00:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=Ko0n1v8SCCEpLE0bJaTH/+BqrhgMgNtYD1qFIvOjONU=; b=wHAjL+DIMTrQYTs1fEsYd20vTx/d25wtyT4z3iQm5v3kvf+uXrZkPReR68b/hgAYlU XHX570Z+6rVItn9Oh2jAWSAR4JGLkL8vzKsZQ1nubm3cXCRcFKKH2pBOngkakdpve2T/ 3LZZKBX9UmbfONMOHHJVPkpV6Mt8VjCQ6DH/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=N4J08Cg8s0tKwzo4futYZ4gW3Szusp9RLIEth99kY8XaCXeO706RfNiJabdRHaHIQC cxHLF0dK+39KK6z+vNxNw/LG/eKdwmhHBuM/QMOOrJCkJYPaToAvi6O88/eLQDIZV/k2 B3aApKb13/TMsSubC+MXWXnZMICgP2HcWj70Q= Received: by 10.141.176.4 with SMTP id d4mr14246304rvp.14.1214289866338; Mon, 23 Jun 2008 23:44:26 -0700 (PDT) Received: by 10.115.108.14 with HTTP; Mon, 23 Jun 2008 23:44:26 -0700 (PDT) Message-ID: <52db57fb0806232344y95eb159ra2dd43a4462ee082@mail.gmail.com> Date: Tue, 24 Jun 2008 12:14:26 +0530 From: "Saradhi Kothapalli" To: freebsd-threads@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Threads stuck in kserel state X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 07:12:47 -0000 Hi I am running FreeBSD 5.4 on my machine. When i run mpd on it, i see it stuck in kserel state. I have written a sample thread program to check whether its an mpd problem or not. Observations on the Sample test program: I have created only one thread from the process, but the top output shows total 3 entries. Even when the thread has finished i see 2 entries that to one in kserel and other in ksesig state. Is the main process stuck in "kserel" state or is it an expected behavior? Is it because of KSE the other thread is shown in top output? Is the state "ksesig" signifies that it is waiting for an event to occur? Thanks in advance for the help. Regards Saradhi The Sample Test program: #include #include #include #include #include #include #include #include #include pthread_mutex_t mutex; static void startFn(void * arg) { printf("\n *** Thread Start Function *** \n"); getchar(); return; } static void endFn(void * arg, int done) { printf("\n *** Thread End Function *** \n"); getchar(); return; } static void thrStart() { struct paction * thr; uint32_t temp; if ( paction_start(&thr, &mutex, startFn, endFn, &temp) == -1 ) { printf("\n *** Failed to start thread *** \n "); getchar(); } return ; } int main() { int ret = pthread_mutex_init(&mutex, NULL); if ( ret != 0 ) { printf("\n *** Mutex initialization Failed *** \n"); return -1; } printf("\n *** calling thread start *** \n "); getchar(); thrStart(); for ( ; ; ) { sleep(1); } return 0; } THE TOP OUTPUT WITH THREAD DISPLAY TURNED ON: When the thread is in existence (both during start and end function): ----------------------------------------------------------------------------------------------------- 18387 root 20 0 3384K 1760K ksesig 0:00 0.00% 0.00% thrd 18387 root 20 0 3384K 1760K kserel 0:00 0.00% 0.00% thrd 18387 root 5 0 3384K 1760K ttyin 0:00 0.00% 0.00% thrd After the thread execution is completed (the for loop): --------------------------------------------------------- 18387 root 20 0 3384K 1752K ksesig 0:00 0.00% 0.00% thrd 18387 root 20 0 3384K 1752K kserel 0:00 0.00% 0.00% thrd From owner-freebsd-threads@FreeBSD.ORG Tue Jun 24 07:37:51 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FDA1065776 for ; Tue, 24 Jun 2008 07:37:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id DA4A28FC17 for ; Tue, 24 Jun 2008 07:37:50 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 9B9252433; Tue, 24 Jun 2008 00:23:22 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id F18CD2D6004; Tue, 24 Jun 2008 00:23:20 -0700 (PDT) Message-ID: <4860A0F4.1040304@elischer.org> Date: Tue, 24 Jun 2008 00:23:32 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Saradhi Kothapalli References: <52db57fb0806232344y95eb159ra2dd43a4462ee082@mail.gmail.com> In-Reply-To: <52db57fb0806232344y95eb159ra2dd43a4462ee082@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: Threads stuck in kserel state X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 07:37:51 -0000 Saradhi Kothapalli wrote: > Hi > > I am running FreeBSD 5.4 on my machine. When i run mpd on it, i see it stuck > in kserel state. > I have written a sample thread program to check whether its an mpd problem > or not. > > Observations on the Sample test program: > > I have created only one thread from the process, but the top output shows > total 3 entries. yes The thread you started in sleeping in ttyin. the thread library greated a background thread to handle signal delivery (ksesig). When the main thread did ttyin, it blocked, so a third thread was created to make sure that if any other work had to be done there was a thread to do it. that third thread is waiting for more work to appear, and in kserel (kse-release). > Even when the thread has finished i see 2 entries that to one in kserel and > other in ksesig state. > > Is the main process stuck in "kserel" state or is it an expected behavior? > Is it because of KSE the other thread is shown in top output? Is the state > "ksesig" signifies that it is waiting for an event to occur? > > > Thanks in advance for the help. > > Regards > Saradhi > > > The Sample Test program: > > #include > #include > #include > #include > #include > #include > #include > #include > #include > > pthread_mutex_t mutex; > > static void > startFn(void * arg) > { > printf("\n *** Thread Start Function *** \n"); > getchar(); > return; > } > > static void > endFn(void * arg, int done) > { > printf("\n *** Thread End Function *** \n"); > getchar(); > return; > } > > static void > thrStart() > { > struct paction * thr; > uint32_t temp; > > if ( paction_start(&thr, &mutex, startFn, endFn, &temp) == -1 ) > { > printf("\n *** Failed to start thread *** \n "); > getchar(); > } > return ; > } > > int main() > { > > int ret = pthread_mutex_init(&mutex, NULL); > if ( ret != 0 ) > { > printf("\n *** Mutex initialization Failed *** \n"); > return -1; > } > > printf("\n *** calling thread start *** \n "); > getchar(); > > thrStart(); > > for ( ; ; ) > { > sleep(1); > } > return 0; > } > > THE TOP OUTPUT WITH THREAD DISPLAY TURNED ON: > > When the thread is in existence (both during start and end function): > ----------------------------------------------------------------------------------------------------- > > 18387 root 20 0 3384K 1760K ksesig 0:00 0.00% 0.00% thrd > 18387 root 20 0 3384K 1760K kserel 0:00 0.00% 0.00% thrd > 18387 root 5 0 3384K 1760K ttyin 0:00 0.00% 0.00% thrd > > After the thread execution is completed (the for loop): > --------------------------------------------------------- > 18387 root 20 0 3384K 1752K ksesig 0:00 0.00% 0.00% thrd > 18387 root 20 0 3384K 1752K kserel 0:00 0.00% 0.00% thrd > _______________________________________________ > 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"