From owner-freebsd-threads@FreeBSD.ORG Mon Jan 30 11:02:53 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 761C216A420 for ; Mon, 30 Jan 2006 11:02:53 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F8743D46 for ; Mon, 30 Jan 2006 11:02:53 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0UB2qNp020025 for ; Mon, 30 Jan 2006 11:02:52 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0UB2pi9020019 for freebsd-threads@freebsd.org; Mon, 30 Jan 2006 11:02:51 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 30 Jan 2006 11:02:51 GMT Message-Id: <200601301102.k0UB2pi9020019@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 Cc: Subject: Current problem reports assigned to you 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, 30 Jan 2006 11:02:53 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -lthr) 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 [threads] [patch] Threaded applications e 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 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/10/05] threads/72353threads Assertion fails in /usr/src/lib/libpthrea o [2004/10/07] threads/72429threads threads blocked in stdio (fgets, etc) are o [2004/10/21] threads/72953threads fork() unblocks blocked signals w/o PTHRE o [2004/12/19] threads/75273threads FBSD 5.3 libpthread (KSE) bug o [2004/12/21] threads/75374threads pthread_kill() ignores SA_SIGINFO flag o [2005/01/26] threads/76694threads fork cause hang in dup()/close() function o [2005/03/10] threads/78660threads Java hangs unkillably in STOP state after o [2005/04/08] threads/79683threads svctcp_create() fails if multiple threads o [2005/04/28] threads/80435threads panic on high loads o [2005/05/19] threads/81258threads Thread specific data is sometimes assigne o [2005/08/02] threads/84483threads problems with devel/nspr and -lc_r on 4.x o [2005/08/20] threads/85160threads [libthr] [patch] libobjc + libpthread/lib o [2005/11/19] threads/89262threads [kernel] [patch] multi-threaded process h o [2005/12/12] threads/90278threads libthr, ULE and -current produces >100% W o [2006/01/03] kern/91266 threads [threads] Trying sleep, but thread marked 29 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- 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 o [2004/11/21] threads/74180threads KSE problem. Applications those riched ma o [2005/04/13] threads/79887threads [patch] freopen() isn't thread-safe o [2005/05/13] threads/80992threads abort() sometimes not caught by gdb depen o [2005/05/26] threads/81534threads [libc_r] [patch] libc_r close() will fail 11 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue Jan 31 12:17:17 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 B6F4116A420 for ; Tue, 31 Jan 2006 12:17:17 +0000 (GMT) (envelope-from Jose-Marcio.Martins@ensmp.fr) Received: from joe.j-chkmail.org (nat-2.ensmp.fr [194.214.158.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1184843D46 for ; Tue, 31 Jan 2006 12:17:16 +0000 (GMT) (envelope-from Jose-Marcio.Martins@ensmp.fr) Received: from [127.0.0.1] (localhost.ensmp.fr [127.0.0.1]) by joe.j-chkmail.org (8.13.4/8.13.4) with ESMTP id k0VCH7hF005885; Tue, 31 Jan 2006 13:17:07 +0100 Message-ID: <43DF5541.1050100@ensmp.fr> Date: Tue, 31 Jan 2006 13:17:05 +0100 From: Jose Marcio Martins da Cruz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: <43D74F91.2090009@ensmp.fr> <43D7C786.1090803@elischer.org> <43D7E45E.8070103@ensmp.fr> <43D802DF.9040003@elischer.org> <43D88E69.1020102@ensmp.fr> <43D922D5.1000307@elischer.org> <43D9324A.40905@ensmp.fr> <43D9345D.9010205@elischer.org> In-Reply-To: <43D9345D.9010205@elischer.org> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms060208020605000301050206" X-Miltered: at joe.j-chkmail.org with ID 43DF5543.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! Cc: freebsd-threads@freebsd.org Subject: Re: Changes from 5.2.1 to 5.3 (theads / signal handling) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jose-Marcio.Martins@ensmp.fr List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 12:17:17 -0000 This is a cryptographically signed message in MIME format. --------------ms060208020605000301050206 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Julian Elischer wrote: > Jose Marcio Martins da Cruz wrote: ... >> This application runs fine under Solaris (four years long now). > > Each implementation has different side-effects Well, Solaris 10 implements fork1 and forkall. forkall man page have many warnings about this issue, but as they implemented, they surely worked hard to minimize side-effects. > On FreeBSD 6, try the libthr() threading library. I turned my code back to as it was before : instead of using a threaded signal handler, I'm using again a handler defined by sigaction. This works fine with libpthread, but not with libthr on a 5.3 machine. I'm doing some more changes, as before defining signal handling, the application "daemonizes" : forks twice, close and redirect stdin, stdout, stderr, ... and so. Removing this, the application beguns to work but there are still problems. So, I'm getting a test machine to install FreeBSD 6 and debug it. But, what's the relations between pre and after 5.3 libpthreads ? What about libptl2 and libthr ? Again, thanks for you answers Jose-Marcio -- --------------------------------------------------------------- Jose Marcio MARTINS DA CRUZ Tel. :(33) 01.40.51.93.41 Ecole des Mines de Paris http://j-chkmail.ensmp.fr 60, bd Saint Michel http://www.ensmp.fr/~martins 75272 - PARIS CEDEX 06 mailto:Jose-Marcio.Martins@ensmp.fr --------------ms060208020605000301050206 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKKDCC BRAwggL4oAMCAQICAwHW9zANBgkqhkiG9w0BAQUFADB5MRAwDgYDVQQKEwdSb290IENBMR4w HAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNBIENlcnQgU2lnbmlu ZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRAY2FjZXJ0Lm9yZzAeFw0wNjAx MjExNDQ4MjBaFw0wNzAxMjExNDQ4MjBaMFMxJDAiBgNVBAMTG0pvc2UtTWFyY2lvIE1hcnRp bnMgZGEgQ3J1ejErMCkGCSqGSIb3DQEJARYcSm9zZS1NYXJjaW8uTWFydGluc0BlbnNtcC5m cjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyu8K6aUJMX2ZJP69UGRaB/gZ2W FzSXUpLmA+1lNGlc40X8D6N9mTwWX/IpI1Ppcxd9QYOBLm2M2Atc7IjV78MXj75dGYbOT0Dz YUovwoTGhKOYg18VIuxQ4rinGEI8eIqX6gMJ/Ftzox3H/og04AiIZxyMClAjuV5QFN7FRRtI uYGYgLaT+Hq5Q2LXizthF0ewXBfqH1GmJFyErhjkxWQTH4Dq8oFZuRnWA4V2Y30Ss6dn1mjx ySA3AsMaMNQTAZssa6R0BOqAFui3vm58zghLL23Mp5De2bpM83Y2mA8yqMEsF0DWr8Hi40a8 6xCYZHqKtTVxjeXqVRv5OxF8J/sCAwEAAaOBxjCBwzAMBgNVHRMBAf8EAjAAMFYGCWCGSAGG +EIBDQRJFkdUbyBnZXQgeW91ciBvd24gY2VydGlmaWNhdGUgZm9yIEZSRUUgaGVhZCBvdmVy IHRvIGh0dHA6Ly93d3cuQ0FjZXJ0Lm9yZzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQU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 1vcwgZMGCyqGSIb3DQEJEAILMYGDoIGAMHkxEDAOBgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsT FWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhv cml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9ydEBjYWNlcnQub3JnAgMB1vcwDQYJKoZIhvcN AQEBBQAEggEAk7px5dW1oPB42KiE4ZQ4myaKw+FtRyY6e7kAF6XjfpM9uUVE0cSIBJcVLHjV nH+udOxaaiaa4xq6qiFrDj/Xezi2oa7MO4F2YYuY6QVMwDKhLlGAztPcwAo2bg7xfGacjPFh E88keK9M/3oMCylfTrMB4HTlKKnQFjVjCG4k+fbU5S72ytht1qs6KjIV8gV51Fku74iDIdNA u9n/80CMCqt/fzB4zXBe09OIPZEdBQnmAdfUhNJHrQtUSJHHAn4oD8KLzzSNf6x3RuWhODq1 sZB4GLobnvw0thaj4nXolqmbMGMpuID++r4LDD58V5SIQ+IkMn0r9OLfxFh6jflMugAAAAAA AA== --------------ms060208020605000301050206-- From owner-freebsd-threads@FreeBSD.ORG Tue Jan 31 20:58:31 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 F0BC616A420 for ; Tue, 31 Jan 2006 20:58:31 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from ottexbe01.corp.distributel.ca (ottexbe01.corp.distributel.ca [206.80.252.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B63643D45 for ; Tue, 31 Jan 2006 20:58:31 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from 10.14.61.42 ([10.14.61.42]) by ottexbe01.corp.distributel.ca ([192.168.16.70]) via Exchange Front-End Server 10.14.61.70 ([10.14.61.70]) with Microsoft Exchange Server HTTP-DAV ; Tue, 31 Jan 2006 20:58:31 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-y1EEhy+mzDMAfUxiLTa6" Received: from paul.mtl.distributel.net by 10.14.61.70; 31 Jan 2006 16:01:03 -0500 Content-class: urn:content-classes:message Date: Tue, 31 Jan 2006 16:01:02 -0500 Message-ID: <1138741262.45596.5.camel@paul> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: libthr question thread-index: AcYmqRd+HhGGLM3TSvCy+52Eg/8AGw== From: "Paul Khavkine" To: Subject: libthr question 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, 31 Jan 2006 20:58:32 -0000 --=-y1EEhy+mzDMAfUxiLTa6 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi guys. I'm having a weird problem. I have an application (FreeRADIUS) that seems to behave very strangly: 1) Compiled against libpthread it simply crashed during a stress test. Always with Signal 6, mostly with "free(): chunk is already free" error. 2) Compiled against libthr, after processing a certain number of requests, the process simply hangs and stops responding. When it does that all threads that were active stay running. When i do top i see ALOT of threads in "lthr" state, and a few in "umtx" state, like this: 72201 root 96 0 5708K 3968K lthr 1 0:01 0.00% 0.00% radiusd 72201 root 96 0 5708K 3968K lthr 0 0:01 0.00% 0.00% radiusd 72201 root 96 0 5708K 3968K umtx 1 0:01 0.00% 0.00% radiusd 72201 root 96 0 5708K 3968K umtx 0 0:01 0.00% 0.00% radiusd 72201 root 96 0 5708K 3968K lthr 0 0:01 0.00% 0.00% radiusd 72201 root 96 0 5708K 3968K lthr 1 0:01 0.00% 0.00% radiusd Any pointers on hoe to debug it ? Where to start ? Thanx Paul --=-y1EEhy+mzDMAfUxiLTa6 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iQCVAwUAQ9/QDvkjFY05CfyYAQKO/AP/VvtY7Ahb97nWu0Y1TD5FocpVBNjIlV8l diU6I2S3DJ6Ho4Qy5MljkFCbAYHCOAf1VDkzkCfSDvOb/hSqhqB92x/0GlJBmQ7y jGooHPom7rbQffiwYGkMhizG7W7SZTgrOXWbIToM29NrdKhBUDQpKZ3CDEq6Z6NR JqxFr8zWvKk= =+6YG -----END PGP SIGNATURE----- --=-y1EEhy+mzDMAfUxiLTa6-- From owner-freebsd-threads@FreeBSD.ORG Tue Jan 31 22:18:33 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 D51CC16A420 for ; Tue, 31 Jan 2006 22:18:33 +0000 (GMT) (envelope-from lists@intricatesoftware.com) Received: from mta5.srv.hcvlny.cv.net (mta5.srv.hcvlny.cv.net [167.206.4.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89AFA43D7F for ; Tue, 31 Jan 2006 22:18:33 +0000 (GMT) (envelope-from lists@intricatesoftware.com) Received: from [172.16.1.72] (ool-457a77e8.dyn.optonline.net [69.122.119.232]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0ITZ00JGG9YC1C10@mta5.srv.hcvlny.cv.net> for freebsd-threads@freebsd.org; Tue, 31 Jan 2006 17:18:13 -0500 (EST) Date: Tue, 31 Jan 2006 17:18:11 -0500 From: Kurt Miller To: freebsd-threads@freebsd.org Message-id: <200601311718.11683.lists@intricatesoftware.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: KMail/1.9 Subject: kse: high prio threads starving low prio threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: kurt@intricatesoftware.com List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 22:18:33 -0000 I'm working on 1.5 jdk certification on 5.4 and 6.0. One of the jck tests hangs because a high priority thread that is yielding is starving the lower priority threads. The following program demonstrates this problem. Using libthr the program finishes. Using kse hangs using all three scheduling policies. Is this the expected behavior of kse? Is there a work-around to the starving issue? Thanks, -Kurt #include #include #include #include #include #include #include #include volatile int init=0; volatile int interrupt=0; static void * yielder(void *arg) { init = 1; while (1) { pthread_yield(); } } static void sighandler(int sig) { interrupt = 1; printf("sighandler\n"); } static void waitForInit() { struct timespec t, rt; while (init == 0) { t.tv_sec = 0; t.tv_nsec = 100000; nanosleep(&t, &rt); } } static void waitForInterrupt() { struct timespec t, rt; while (interrupt == 0) { t.tv_sec = 0; t.tv_nsec = 100000; nanosleep(&t, &rt); } } int main(int argc, char *argv[]) { pthread_t yldr; pthread_attr_t attr; struct sigaction act; /* Install a signal handler for SIGUSR1 */ sigemptyset (&act.sa_mask); sigaddset (&act.sa_mask, SIGUSR1); act.sa_handler = sighandler; act.sa_flags = 0; sigaction (SIGUSR1, &act, NULL); pthread_attr_init(&attr); pthread_attr_setschedpolicy(&attr, SCHED_FIFO); pthread_create(&yldr, &attr, yielder, NULL); pthread_setprio(yldr, 16); waitForInit(); if(pthread_kill(yldr, SIGUSR1) != 0) printf("pthread_kill failed with errno = %d\n", errno); waitForInterrupt(); } From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 01:28:45 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 570A916A420 for ; Wed, 1 Feb 2006 01:28:45 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7BD043D48 for ; Wed, 1 Feb 2006 01:28:44 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k111Sh8v000285; Tue, 31 Jan 2006 20:28:43 -0500 (EST) Date: Tue, 31 Jan 2006 20:28:43 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: kurt@intricatesoftware.com In-Reply-To: <200601311718.11683.lists@intricatesoftware.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: kse: high prio threads starving low prio threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 01:28:45 -0000 On Tue, 31 Jan 2006, Kurt Miller wrote: > I'm working on 1.5 jdk certification on 5.4 and 6.0. One of the > jck tests hangs because a high priority thread that is yielding > is starving the lower priority threads. The following program > demonstrates this problem. Using libthr the program finishes. > Using kse hangs using all three scheduling policies. > > Is this the expected behavior of kse? It is the expected behavior for any POSIX threads library that supports SCHED_FIFO and priorities and also running on a system with one scheduling allocation domain (one CPU). libthr does not support posix priority scheduling. > > Is there a work-around to the starving issue? It is working as it should. Recode it not to use priorities if that is what you want. -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 01:31:26 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 D1AEF16A420 for ; Wed, 1 Feb 2006 01:31:25 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5EACA43D46 for ; Wed, 1 Feb 2006 01:31:25 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k111VNPJ003043; Tue, 31 Jan 2006 20:31:23 -0500 (EST) Date: Tue, 31 Jan 2006 20:31:23 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Paul Khavkine In-Reply-To: <1138741262.45596.5.camel@paul> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: libthr question X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 01:31:26 -0000 On Tue, 31 Jan 2006, Paul Khavkine wrote: > > > Hi guys. > > > I'm having a weird problem. I have an application (FreeRADIUS) that > seems to behave very strangly: > > 1) Compiled against libpthread it simply crashed during a stress test. > Always with Signal 6, mostly with "free(): chunk is already free" error. > > Any pointers on hoe to debug it ? Where to start ? Use electric fence to debug FreeRADIUS? -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 01:44:01 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 3E11D16A420; Wed, 1 Feb 2006 01:44:01 +0000 (GMT) (envelope-from kurt@intricatesoftware.com) Received: from mta5.srv.hcvlny.cv.net (mta5.srv.hcvlny.cv.net [167.206.4.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id E520B43D49; Wed, 1 Feb 2006 01:44:00 +0000 (GMT) (envelope-from kurt@intricatesoftware.com) Received: from [172.16.1.72] (ool-457a77e8.dyn.optonline.net [69.122.119.232]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0ITZ0021ZJHBOG50@mta5.srv.hcvlny.cv.net>; Tue, 31 Jan 2006 20:44:00 -0500 (EST) Date: Tue, 31 Jan 2006 20:43:58 -0500 From: Kurt Miller In-reply-to: To: freebsd-threads@freebsd.org, Daniel Eischen Message-id: <200601312043.59043.kurt@intricatesoftware.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline References: User-Agent: KMail/1.9 Cc: Subject: Re: kse: high prio threads starving low prio threads 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: Wed, 01 Feb 2006 01:44:01 -0000 On Tuesday 31 January 2006 8:28 pm, Daniel Eischen wrote: > On Tue, 31 Jan 2006, Kurt Miller wrote: > > > I'm working on 1.5 jdk certification on 5.4 and 6.0. One of the > > jck tests hangs because a high priority thread that is yielding > > is starving the lower priority threads. The following program > > demonstrates this problem. Using libthr the program finishes. > > Using kse hangs using all three scheduling policies. > > > > Is this the expected behavior of kse? > > It is the expected behavior for any POSIX threads library > that supports SCHED_FIFO and priorities and also running > on a system with one scheduling allocation domain (one CPU). > libthr does not support posix priority scheduling. Thanks for the reply. I realized that after sending the message. The jck test is flawed and we will be appealing it with Sun. > > > > Is there a work-around to the starving issue? > > It is working as it should. Recode it not to use priorities > if that is what you want. > From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 01:48:55 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 B23AC16A420 for ; Wed, 1 Feb 2006 01:48:55 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 263D143D45 for ; Wed, 1 Feb 2006 01:48:55 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k111msMn025143; Tue, 31 Jan 2006 20:48:54 -0500 (EST) Date: Tue, 31 Jan 2006 20:48:54 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Kurt Miller In-Reply-To: <200601312043.59043.kurt@intricatesoftware.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: kse: high prio threads starving low prio threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 01:48:55 -0000 On Tue, 31 Jan 2006, Kurt Miller wrote: > On Tuesday 31 January 2006 8:28 pm, Daniel Eischen wrote: > > On Tue, 31 Jan 2006, Kurt Miller wrote: > > > > > I'm working on 1.5 jdk certification on 5.4 and 6.0. One of the > > > jck tests hangs because a high priority thread that is yielding > > > is starving the lower priority threads. The following program > > > demonstrates this problem. Using libthr the program finishes. > > > Using kse hangs using all three scheduling policies. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I missed this part previously. Our default scheduling policy (SCHED_OTHER) is SCHED_RR and supports thread priorities. This is allowed by POSIX, so the behavior is also as expected. -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 12:04:34 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 E19F616A420 for ; Wed, 1 Feb 2006 12:04:34 +0000 (GMT) (envelope-from ilyaver@mail.ru) Received: from mx2.mail.ru (mx2.mail.ru [194.67.23.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AE1243D45 for ; Wed, 1 Feb 2006 12:04:34 +0000 (GMT) (envelope-from ilyaver@mail.ru) Received: from [212.248.54.61] (port=1930 helo=ASD-73A57321383) by mx2.mail.ru with esmtp id 1F4Giu-0008gg-00 for freebsd-threads@freebsd.org; Wed, 01 Feb 2006 15:04:32 +0300 Date: Wed, 1 Feb 2006 15:04:29 +0300 From: Ilya E Veretenkin X-Mailer: The Bat! (v3.0) Professional X-Priority: 3 (Normal) Message-ID: <408955619.20060201150429@mail.ru> To: freebsd-threads@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit Subject: getting particular thread cpu time X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ilya E Veretenkin List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 12:04:35 -0000 Здравствуйте, freebsd-threads. Hello. I am writing a multi-threaded application and want to see the cpu usage of each thread of this application. I know that 'ps -H' outputs cpu usage information for threads, but how can I found out the correspondence between particular thread in 'ps-H' output and particular thread ID in my application? -- С уважением, Ilya mailto:ilyaver@mail.ru From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 13:33:51 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 D8B3D16A420 for ; Wed, 1 Feb 2006 13:33:51 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8293743D45 for ; Wed, 1 Feb 2006 13:33:49 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k11DXmX5020619; Wed, 1 Feb 2006 08:33:48 -0500 (EST) Date: Wed, 1 Feb 2006 08:33:48 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Ilya E Veretenkin In-Reply-To: <408955619.20060201150429@mail.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 13:33:52 -0000 On Wed, 1 Feb 2006, Ilya E Veretenkin wrote: > Hello. > I am writing a multi-threaded application and want to see the cpu > usage of each thread of this application. > I know that 'ps -H' outputs cpu usage information for threads, but how > can I found out the correspondence between particular thread in 'ps-H' > output and particular thread ID in my application? You can't, unless: 1) Every thread is system scope; or 2) You use libthr where every thread maps 1:1 to a kernel thread Even then, I don't know whether CPU usage is maintained correctly yet by the kernel for a multi-threaded process. Someone has been working on it recently. Libpthread is M:N by default, so the kernel doesn't know about userland threads. -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 19:01:16 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 7A5F816A420; Wed, 1 Feb 2006 19:01:16 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from ottexbe01.corp.distributel.ca (ottexbe01.corp.distributel.ca [206.80.252.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03EAE43D53; Wed, 1 Feb 2006 19:01:15 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from 10.14.61.42 ([10.14.61.42]) by ottexbe01.corp.distributel.ca ([192.168.16.70]) via Exchange Front-End Server 10.14.61.70 ([10.14.61.70]) with Microsoft Exchange Server HTTP-DAV ; Wed, 1 Feb 2006 19:01:13 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rbPSRxbW/Y0y1T4ZbQDK" Received: from paul.mtl.distributel.net by 10.14.61.70; 01 Feb 2006 14:03:49 -0500 In-Reply-To: Content-class: urn:content-classes:message Date: Wed, 1 Feb 2006 14:03:49 -0500 Message-ID: <1138820629.45596.8.camel@paul> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: libthr question thread-index: AcYnYd8YFmGyf4x9QbS9SDVMjzHUMg== References: From: "Paul Khavkine" To: "Daniel Eischen" Cc: freebsd-threads@freebsd.org Subject: Re: libthr question 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: Wed, 01 Feb 2006 19:01:16 -0000 --=-rbPSRxbW/Y0y1T4ZbQDK Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Daniel. I tried running the application with Electric Fence and this is what i get: ElectricFence Exiting: mmap() failed: Cannot allocate memory Thanx Paul On Tue, 2006-01-31 at 20:31 -0500, Daniel Eischen wrote: > On Tue, 31 Jan 2006, Paul Khavkine wrote: >=20 > > > > > > Hi guys. > > > > > > I'm having a weird problem. I have an application (FreeRADIUS) that > > seems to behave very strangly: > > > > 1) Compiled against libpthread it simply crashed during a stress test. > > Always with Signal 6, mostly with "free(): chunk is already free" error= . > > > > Any pointers on hoe to debug it ? Where to start ? >=20 > Use electric fence to debug FreeRADIUS? >=20 --=-rbPSRxbW/Y0y1T4ZbQDK Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iQCVAwUAQ+EGFfkjFY05CfyYAQJ10AQAi2OwTXmO/b2KaPTApe9eiZjFszAwV4MZ DKZOo6gi8K1mdEwtY3SS/YCNW4I8Imac96rynF5wsp9dlZjnVHsdxNMcy7jFc1L0 BY7FIisQ5y/weANlXDHRtNO6Dug9dJfL2xEs/e5rJK6CzJCl8r18c63c3hrWlRpM FqCaaV2bq4w= =lKNa -----END PGP SIGNATURE----- --=-rbPSRxbW/Y0y1T4ZbQDK-- From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 19:10:30 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 A266316A420 for ; Wed, 1 Feb 2006 19:10:30 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1854743D4C for ; Wed, 1 Feb 2006 19:10:29 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k11JAS9n019304; Wed, 1 Feb 2006 14:10:28 -0500 (EST) Date: Wed, 1 Feb 2006 14:10:27 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Paul Khavkine In-Reply-To: <1138820629.45596.8.camel@paul> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: libthr question X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 19:10:30 -0000 On Wed, 1 Feb 2006, Paul Khavkine wrote: > > Hi Daniel. > > > I tried running the application with Electric Fence and this is what i > get: > > ElectricFence Exiting: mmap() failed: Cannot allocate memory I've no clue. ulimits? -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 19:19:00 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 C761716A420 for ; Wed, 1 Feb 2006 19:19:00 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9025A43D46 for ; Wed, 1 Feb 2006 19:19:00 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 01 Feb 2006 11:19:00 -0800 Message-ID: <43E109A3.8080904@elischer.org> Date: Wed, 01 Feb 2006 11:18:59 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ilya E Veretenkin References: <408955619.20060201150429@mail.ru> In-Reply-To: <408955619.20060201150429@mail.ru> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time 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: Wed, 01 Feb 2006 19:19:00 -0000 Ilya E Veretenkin wrote: >Здравствуйте, freebsd-threads. > >Hello. >I am writing a multi-threaded application and want to see the cpu >usage of each thread of this application. >I know that 'ps -H' outputs cpu usage information for threads, but how >can I found out the correspondence between particular thread in 'ps-H' >output and particular thread ID in my app > if you use libthr you will see a separate kernel thread for each thread. Unfortunatly we are still working on thread statistics so you may not get much in theway of good statistics yet. Thread stats are the next thing for me to work on but I have a $REALJOB time crunch at the moment. >lication? > > > From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 19:20:18 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 A02FF16A420; Wed, 1 Feb 2006 19:20:18 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64ADC43D46; Wed, 1 Feb 2006 19:20:18 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 01 Feb 2006 11:20:18 -0800 Message-ID: <43E109F1.6020304@elischer.org> Date: Wed, 01 Feb 2006 11:20:17 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Ilya E Veretenkin , freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time 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: Wed, 01 Feb 2006 19:20:18 -0000 Daniel Eischen wrote: >On Wed, 1 Feb 2006, Ilya E Veretenkin wrote: > > > >>Hello. >>I am writing a multi-threaded application and want to see the cpu >>usage of each thread of this application. >>I know that 'ps -H' outputs cpu usage information for threads, but how >>can I found out the correspondence between particular thread in 'ps-H' >>output and particular thread ID in my application? >> >> > >You can't, unless: > > 1) Every thread is system scope; or > 2) You use libthr where every thread maps 1:1 to a kernel thread > >Even then, I don't know whether CPU usage is maintained correctly >yet by the kernel for a multi-threaded process. Someone has been >working on it recently. > >Libpthread is M:N by default, so the kernel doesn't know about >userland threads. > > though we might think about ways that we can get that information.. maybe a way that the user thread scheduler can be asked for the info? From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 19:34:31 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 8FA6216A420 for ; Wed, 1 Feb 2006 19:34:31 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEAAF43D49 for ; Wed, 1 Feb 2006 19:34:30 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k11JYQwN014298; Wed, 1 Feb 2006 14:34:26 -0500 (EST) Date: Wed, 1 Feb 2006 14:34:25 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Julian Elischer In-Reply-To: <43E109F1.6020304@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Ilya E Veretenkin , freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 19:34:31 -0000 On Wed, 1 Feb 2006, Julian Elischer wrote: > Daniel Eischen wrote: > > >Libpthread is M:N by default, so the kernel doesn't know about > >userland threads. > > > > > > though we might think about ways that we can get that information.. > maybe a way that the user thread scheduler can be asked for the info? We don't currently maintain per-thread system and user time. It's not just that either, there has to be some way to identify each thread and the kernel would need that info (name, thread id, ??) also. You _could_ add pthread_getrusage_np(), or something like that, to the threads libraries which would make it visible to the application, but I hesitate to think this information would be useful to the kernel so that ps and top can show it. I think ps and top should just show the kernel entities and that's it. I wouldn't strongly oppose making these utilities show userland thread info as long as it didn't impact performance. -- DE From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 20:07:36 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 1F72A16A422; Wed, 1 Feb 2006 20:07:36 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from ottexbe01.corp.distributel.ca (ottexbe01.corp.distributel.ca [206.80.252.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5613143D45; Wed, 1 Feb 2006 20:07:17 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from 10.14.61.42 ([10.14.61.42]) by ottexbe01.corp.distributel.ca ([192.168.16.70]) via Exchange Front-End Server 10.14.61.70 ([10.14.61.70]) with Microsoft Exchange Server HTTP-DAV ; Wed, 1 Feb 2006 20:07:17 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GKcp7dJ8kNKnBinwT0wL" Received: from paul.mtl.distributel.net by 10.14.61.70; 01 Feb 2006 15:09:54 -0500 In-Reply-To: Content-class: urn:content-classes:message Date: Wed, 1 Feb 2006 15:09:53 -0500 Message-ID: <1138824593.45596.10.camel@paul> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: libthr question thread-index: AcYnaxnmnCM4dEojRMmyck3k1XE12w== References: From: "Paul Khavkine" To: "Daniel Eischen" Cc: freebsd-threads@freebsd.org Subject: Re: libthr question 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: Wed, 01 Feb 2006 20:07:36 -0000 --=-GKcp7dJ8kNKnBinwT0wL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2006-02-01 at 14:10 -0500, Daniel Eischen wrote: > On Wed, 1 Feb 2006, Paul Khavkine wrote: >=20 > > > > Hi Daniel. > > > > > > I tried running the application with Electric Fence and this is what i > > get: > > > > ElectricFence Exiting: mmap() failed: Cannot allocate memory >=20 > I've no clue. ulimits? >=20 I got a little bit further, this is what i get now: ElectricFence Aborting: Allocating 0 bytes, probably a bug. Program received signal SIGILL, Illegal instruction. [Switching to Thread 2 (LWP 100439)] 0x2820639b in pthread_testcancel () from /usr/lib/libpthread.so.1 (gdb) bt #0 0x2820639b in pthread_testcancel () from /usr/lib/libpthread.so.1 #1 0x281f6150 in sigaction () from /usr/lib/libpthread.so.1 #2 0x281f6cd7 in sigaction () from /usr/lib/libpthread.so.1 #3 0x281f54df in sigaction () from /usr/lib/libpthread.so.1 #4 0x281f5260 in sigaction () from /usr/lib/libpthread.so.1 #5 0x281fe902 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1 #6 0x00000000 in ?? () (gdb) Thanx Paul --=-GKcp7dJ8kNKnBinwT0wL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iQCVAwUAQ+EVkfkjFY05CfyYAQIK7wP/X6oHUG4pbxIMfmPlWFL3q2czScn+WVN4 eUIuUOfXb7URbuZEMSY68L7sueuauOaziH1koJSkX46YTNOYE8GUasxmcjlo1IG1 N/4/tgk4OYw6Q8y09RMsKGQb7h6+MoTRzOYyCyiGB3HZn/y/68B/N127U0kDxS3q FSEU3tP18Jk= =nKlY -----END PGP SIGNATURE----- --=-GKcp7dJ8kNKnBinwT0wL-- From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 20:31:58 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 E652B16A420; Wed, 1 Feb 2006 20:31:58 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D71F43D60; Wed, 1 Feb 2006 20:31:58 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 01 Feb 2006 12:31:58 -0800 Message-ID: <43E11ABD.6050503@elischer.org> Date: Wed, 01 Feb 2006 12:31:57 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Ilya E Veretenkin , freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time 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: Wed, 01 Feb 2006 20:31:59 -0000 Daniel Eischen wrote: >On Wed, 1 Feb 2006, Julian Elischer wrote: > > > >>Daniel Eischen wrote: >> >> >> >>>Libpthread is M:N by default, so the kernel doesn't know about >>>userland threads. >>> >>> >>> >>> >>though we might think about ways that we can get that information.. >>maybe a way that the user thread scheduler can be asked for the info? >> >> > >We don't currently maintain per-thread system and user time. >It's not just that either, there has to be some way to identify >each thread and the kernel would need that info (name, thread >id, ??) also. You _could_ add pthread_getrusage_np(), or >something like that, to the threads libraries which would >make it visible to the application, but I hesitate to think >this information would be useful to the kernel so that ps >and top can show it. I think ps and top should just show >the kernel entities and that's it. I wouldn't strongly >oppose making these utilities show userland thread info >as long as it didn't impact performance. > > I was thinking of a tool to help developers do usage monitoring on their programs. as a debugging aid.. We DO put usage information into the KSE mailbox do we not? when you come back from a kernel call you should find stats there from memory. (however I'm not going to go look now as I need to get on with $REALJOB and have promised myself that this will wait until I get enough time to do teh stats properly. From owner-freebsd-threads@FreeBSD.ORG Thu Feb 2 22:31:50 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org 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 153EF16A420; Thu, 2 Feb 2006 22:31:50 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from ottexbe01.corp.distributel.ca (ottexbe01.corp.distributel.ca [206.80.252.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A03743D46; Thu, 2 Feb 2006 22:31:49 +0000 (GMT) (envelope-from paul.khavkine@distributel.ca) Received: from 10.14.61.42 ([10.14.61.42]) by ottexbe01.corp.distributel.ca ([192.168.16.70]) via Exchange Front-End Server 10.14.61.70 ([10.14.61.70]) with Microsoft Exchange Server HTTP-DAV ; Thu, 2 Feb 2006 22:31:49 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-9drQt/UkP/MpPR8K2lAJ" Received: from paul.mtl.distributel.net by 10.14.61.70; 02 Feb 2006 17:34:30 -0500 In-Reply-To: Content-class: urn:content-classes:message Date: Thu, 2 Feb 2006 17:34:30 -0500 Message-ID: <1138919670.45596.16.camel@paul> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: pthread malloc and abort() (Was: libthr question) thread-index: AcYoSHTikyXUITU4RQGUHnngvHvRvQ== References: From: "Paul Khavkine" To: "Daniel Eischen" Cc: freebsd-threads@freebsd.org Subject: Re: pthread malloc and abort() (Was: libthr question) 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: Thu, 02 Feb 2006 22:31:50 -0000 --=-9drQt/UkP/MpPR8K2lAJ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2006-02-01 at 14:10 -0500, Daniel Eischen wrote: > On Wed, 1 Feb 2006, Paul Khavkine wrote: >=20 > > > > Hi Daniel. > > > > > > I tried running the application with Electric Fence and this is what i > > get: > > > > ElectricFence Exiting: mmap() failed: Cannot allocate memory >=20 > I've no clue. ulimits? >=20 Hi. I had no luck setting up ElectricFence. Now my question is, the application dies with either free() or realloc() errors and sig Abort. However it does not produce a core dump, even when i run it in gdb, gdb either dies itself with sig abort or says something like "abort, process went away". Is this normal, it seems that it SHOULD produce a core file. Btw, the program is compiled with libpthread. OS version is: 5.4-RELEASE-p6 SMP Hardware is: DL360 G4 dual Xeon 3Ghz, 2G memory, 2x36G U320 drives in RAID1 config. This does not happend when running a UP kernel, only SMP. Any pointers on why this is happening ? Paul --=-9drQt/UkP/MpPR8K2lAJ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iQCVAwUAQ+KI9vkjFY05CfyYAQLMqAP/Xz3MFh46WMARS6rRhT2i52YRnZ9dYCTt j4QtwaDpD3KCUrawyeGWAMDdhPtVnZ635k0ztqVy+KLzGWOmUz1tA6U38QjPGTTb cogexxPtH128CXvRbaa+5lsoimL5nt9IXp7Yeyb70pfuckHZNlqpFKq+viIDn4Yi 0uM2t453aBU= =bzP7 -----END PGP SIGNATURE----- --=-9drQt/UkP/MpPR8K2lAJ--