From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 03:31:34 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 97A8816A4CE for ; Mon, 30 Aug 2004 03:31:34 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CA9143D5C for ; Mon, 30 Aug 2004 03:31:34 +0000 (GMT) (envelope-from llvvang@gmail.com) Received: by mproxy.gmail.com with SMTP id 77so57720rnl for ; Sun, 29 Aug 2004 20:31:33 -0700 (PDT) Received: by 10.38.11.77 with SMTP id 77mr760954rnk; Sun, 29 Aug 2004 20:31:33 -0700 (PDT) Received: by 10.38.78.35 with HTTP; Sun, 29 Aug 2004 20:31:33 -0700 (PDT) Message-ID: <7c64b0b040829203166db7f5e@mail.gmail.com> Date: Sun, 29 Aug 2004 22:31:33 -0500 From: "Li-Lun Wang (Leland)" To: freebsd-threads@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: zsnes hangs when using libpthread.so.1 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Li-Lun Wang \(Leland\)" List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2004 03:31:34 -0000 Hi, Sorry that I am not sure whether I should report this problem to this list, freebsd-ports, freebsd-emulation, or use send-pr. I have been encountering this problem for a while (several months, I believe, maybe since we switched to kse). When I run emulators/zsnes with configuration files already present, zsnes hangs with the state kserel after it loads a rom. If I change libpthread.so.1 to libc_r.so.5 with libmap, it runs without such problem. Is this a known problem? How can I help on this problem? Regards, Leland Wang From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 05:57:31 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 8635816A4CE for ; Mon, 30 Aug 2004 05:57:31 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B69F43D46 for ; Mon, 30 Aug 2004 05:57:30 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.134] (h86.vuokselantie10.fi [193.64.42.134]) by silver.he.iki.fi (8.12.10/8.11.4) with ESMTP id i7U5vRm1064665 for ; Mon, 30 Aug 2004 08:57:28 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <4132C1CA.8070602@he.iki.fi> Date: Mon, 30 Aug 2004 08:57:30 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: sharing mutexes 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, 30 Aug 2004 05:57:31 -0000 Is there currently a supported way to share mutexes across processes? Pete From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 07:14:34 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 1A31C16A4CE for ; Mon, 30 Aug 2004 07:14:34 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id D916B43D53 for ; Mon, 30 Aug 2004 07:14:33 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i7U7H7Dt001122; Mon, 30 Aug 2004 00:17:07 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i7U7H7iS001121; Mon, 30 Aug 2004 00:17:07 -0700 Date: Mon, 30 Aug 2004 00:17:07 -0700 From: Brooks Davis To: Petri Helenius Message-ID: <20040830071707.GB28061@odin.ac.hmc.edu> References: <4132C1CA.8070602@he.iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: <4132C1CA.8070602@he.iki.fi> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: freebsd-threads@freebsd.org Subject: Re: sharing mutexes 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, 30 Aug 2004 07:14:34 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 30, 2004 at 08:57:30AM +0300, Petri Helenius wrote: >=20 > Is there currently a supported way to share mutexes across processes? That depends on what you mean. You can use sysv semaphores between processes, but their API is problematic in some applications. Could you explain what you want to do in more detail? -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBMtRyXY6L6fI4GtQRAhzwAKCTr8bTQB8EbkjvxqJYGE10pepIowCfWO4q gGnzKjSCmZzZLXpZHuz44hA= =XZwf -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 07:48: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 2132016A4CE for ; Mon, 30 Aug 2004 07:48:12 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id F20C043D5A for ; Mon, 30 Aug 2004 07:48:10 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [195.163.185.142] (i2-142.rommon.fi [195.163.185.142]) by silver.he.iki.fi (8.12.10/8.11.4) with ESMTP id i7U7m8m1020008; Mon, 30 Aug 2004 10:48:09 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <4132DBBB.4020008@he.iki.fi> Date: Mon, 30 Aug 2004 10:48:11 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <4132C1CA.8070602@he.iki.fi> <20040830071707.GB28061@odin.ac.hmc.edu> In-Reply-To: <20040830071707.GB28061@odin.ac.hmc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: sharing mutexes 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, 30 Aug 2004 07:48:12 -0000 Brooks Davis wrote: > >That depends on what you mean. You can use sysv semaphores between >processes, but their API is problematic in some applications. > >Could you explain what you want to do in more detail? > > I have multiple processes running threaded applications which would like to do 64bit wide atomic arithmetic, which if I understand correctly can only be achieved either via IPC (having a master process to do all the stuff) or sharing a mutex somehow. And as far as I understand, mutexes are process-local by default. Pete From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 08:09:31 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 F389216A4CE for ; Mon, 30 Aug 2004 08:09:30 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id D593E43D1F for ; Mon, 30 Aug 2004 08:09:30 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i7U8C5MP005315; Mon, 30 Aug 2004 01:12:05 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i7U8C5Rr005314; Mon, 30 Aug 2004 01:12:05 -0700 Date: Mon, 30 Aug 2004 01:12:05 -0700 From: Brooks Davis To: Petri Helenius Message-ID: <20040830081205.GE28061@odin.ac.hmc.edu> References: <4132C1CA.8070602@he.iki.fi> <20040830071707.GB28061@odin.ac.hmc.edu> <4132DBBB.4020008@he.iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MIdTMoZhcV1D07fI" Content-Disposition: inline In-Reply-To: <4132DBBB.4020008@he.iki.fi> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: freebsd-threads@freebsd.org Subject: Re: sharing mutexes 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, 30 Aug 2004 08:09:31 -0000 --MIdTMoZhcV1D07fI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 30, 2004 at 10:48:11AM +0300, Petri Helenius wrote: > Brooks Davis wrote: >=20 > >That depends on what you mean. You can use sysv semaphores between > >processes, but their API is problematic in some applications. > > > >Could you explain what you want to do in more detail? > >=20 > I have multiple processes running threaded applications which would like= =20 > to do 64bit wide atomic arithmetic, which if I understand correctly can= =20 > only be achieved either via IPC (having a master process to do all the=20 > stuff) or sharing a mutex somehow. And as far as I understand, mutexes=20 > are process-local by default. If you actully have a multi-process, multi-threaded application doing writes to shared memory, they you probably need to use sysv semaphores at this point since I think that's our only only portable, multi-process locking mechanism at this point. The code for POSIX sempahores seems to indicate that you can use them in multiple processes if they are created before a fork, but I've never tried that. If you have a multi-threaded application which is not multi-process, sysv semaphores or posix semaphores will work. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --MIdTMoZhcV1D07fI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBMuFUXY6L6fI4GtQRAptnAJ0V3rxYB71U8VTloBgRyQ5ynJcIKgCg3iVL mW+nVHBgSoC51/oMyb/61xw= =H32O -----END PGP SIGNATURE----- --MIdTMoZhcV1D07fI-- From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 11:02:09 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 2B53316A508 for ; Mon, 30 Aug 2004 11:02:09 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08EFE43D58 for ; Mon, 30 Aug 2004 11:02:09 +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 i7UB28nB034002 for ; Mon, 30 Aug 2004 11:02:08 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7UB285b033996 for freebsd-threads@freebsd.org; Mon, 30 Aug 2004 11:02:08 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 30 Aug 2004 11:02:08 GMT Message-Id: <200408301102.i7UB285b033996@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, 30 Aug 2004 11:02:09 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/04/22] threads/65883threads libkse's sigwait does not work after fork 3 problems 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] misc/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] misc/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] misc/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 o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when 14 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/26] misc/18824 threads gethostbyname is not thread safe o [2000/10/21] misc/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 6 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 11:51:50 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 6082716A4CE for ; Mon, 30 Aug 2004 11:51:50 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC2CC43D1F for ; Mon, 30 Aug 2004 11:51:47 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i7UBpiWf019454; Mon, 30 Aug 2004 07:51:47 -0400 (EDT) Date: Mon, 30 Aug 2004 07:51:44 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Petri Helenius In-Reply-To: <4132C1CA.8070602@he.iki.fi> 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: sharing mutexes X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 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: Mon, 30 Aug 2004 11:51:50 -0000 On Mon, 30 Aug 2004, Petri Helenius wrote: > > Is there currently a supported way to share mutexes across processes? No, pshared mutexes, CVs, and semaphores are not implemented. We will probably add them to FreeBSD-6.0, but they will break ABI and require a libc version bump. -- Dan From owner-freebsd-threads@FreeBSD.ORG Mon Aug 30 19:25:53 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 99EDD16A4CF for ; Mon, 30 Aug 2004 19:25:53 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BF0943D3F for ; Mon, 30 Aug 2004 19:25:53 +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 0ABFA7A3D2; Mon, 30 Aug 2004 12:25:53 -0700 (PDT) Message-ID: <41337F40.6070409@elischer.org> Date: Mon, 30 Aug 2004 12:25:52 -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: Justin Smith References: <41336B5E.7080000@drexel.edu> In-Reply-To: <41336B5E.7080000@drexel.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: threads@freebsd.org Subject: Re: Thread problems 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, 30 Aug 2004 19:25:53 -0000 should be sent to threads@freebsd.org (CC'd) for what its worth, I'm not sure we support pthread_getschedparam to any extent.. what's Gthread? what does ldd (program name) show? Justin Smith wrote: > FreeBSD jsmith.org 5.3-BETA2 FreeBSD 5.3-BETA2 #0: Mon Aug 30 06:37:58 > EDT 2004 root@:/usr/obj/usr/src/sys/MYKERNEL i386 > > The pan newsreader (recompiled) crashes on startup: > > > GThread-ERROR **: file gthread-posix.c: line 137 (): error 'No such > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)' > aborting... > Abort trap (core dumped) > -bash-2.05b$ > From owner-freebsd-threads@FreeBSD.ORG Tue Aug 31 10:14:47 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 E491F16A4CE for ; Tue, 31 Aug 2004 10:14:47 +0000 (GMT) Received: from shim1.irt.drexel.edu (shim1.irt.drexel.edu [144.118.29.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1E8943D54 for ; Tue, 31 Aug 2004 10:14:47 +0000 (GMT) (envelope-from jsmith@drexel.edu) Received: from conversion-daemon.shim1.irt.drexel.edu by shim1.irt.drexel.edu (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) id <0I3B00M012QDQT@shim1.irt.drexel.edu> for threads@freebsd.org; Tue, 31 Aug 2004 06:14:46 -0400 (EDT) Received: from vorpal.math.drexel.edu (vorpal.math.drexel.edu [129.25.6.250]) by shim1.irt.drexel.edu (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) with ESMTP id <0I3B009ZR34M6X@shim1.irt.drexel.edu> for threads@freebsd.org; Tue, 31 Aug 2004 06:14:46 -0400 (EDT) Received: from [IPv6:::1] (vorpal.math.drexel.edu [129.25.6.250]) i7VAEjHY000891 for ; Tue, 31 Aug 2004 06:14:46 -0400 (EDT envelope-from jsmith@drexel.edu) Date: Tue, 31 Aug 2004 06:14:44 -0400 From: Justin Smith To: threads@freebsd.org Message-id: <41344F94.1010202@drexel.edu> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040806) Subject: Thread problem 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: Tue, 31 Aug 2004 10:14:48 -0000 > FreeBSD jsmith.org 5.3-BETA2 FreeBSD 5.3-BETA2 #0: Mon Aug 30 06:37:58 > EDT 2004 root@:/usr/obj/usr/src/sys/MYKERNEL i386 > > The pan newsreader (recompiled) crashes on startup: > > > GThread-ERROR **: file gthread-posix.c: line 137 (): error 'No such > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)' > aborting... > Abort trap (core dumped) > -bash-2.05b$ > -- Time blows wildly against my door | Justin R. Smith Stirring discarded sorrows | Mathematics Department Like dead leaves of summers past | Drexel University Shadows of what went before | Philadelphia, PA 19104 Making way for new tomorrows | New hopes, new fears, | Office: (215) 895-1847 and new ways that last | URL: vorpal.math.drexel.edu From owner-freebsd-threads@FreeBSD.ORG Tue Aug 31 12:06: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 81CAD16A4CE for ; Tue, 31 Aug 2004 12:06:12 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20CB243D39 for ; Tue, 31 Aug 2004 12:06:12 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i7VC6A3R028621; Tue, 31 Aug 2004 08:06:10 -0400 (EDT) Date: Tue, 31 Aug 2004 08:06:09 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Justin Smith In-Reply-To: <41344F94.1010202@drexel.edu> 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: threads@freebsd.org Subject: Re: Thread problem X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 31 Aug 2004 12:06:12 -0000 On Tue, 31 Aug 2004, Justin Smith wrote: > > FreeBSD jsmith.org 5.3-BETA2 FreeBSD 5.3-BETA2 #0: Mon Aug 30 06:37:58 > > EDT 2004 root@:/usr/obj/usr/src/sys/MYKERNEL i386 > > > > The pan newsreader (recompiled) crashes on startup: > > > > > > GThread-ERROR **: file gthread-posix.c: line 137 (): error 'No such > > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)' > > aborting... > > Abort trap (core dumped) > > -bash-2.05b$ Someone else already replied to this. Show 'ldd '. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Aug 31 18:36: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 5682216A4CE; Tue, 31 Aug 2004 18:36: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 0AD1D43D58; Tue, 31 Aug 2004 18:36:11 +0000 (GMT) (envelope-from julian@vicor.com) Received: from vicor.com (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id E6B9A7A403; Tue, 31 Aug 2004 11:36:10 -0700 (PDT) Message-ID: <4134C51A.8010207@vicor.com> Date: Tue, 31 Aug 2004 11:36:10 -0700 From: Julian Elischer Organization: VICOR 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: freebsd-stable@freebsd.org, threads@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: 4-stable termios diff behaviour lc/lc_r 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: Tue, 31 Aug 2004 18:36:11 -0000 this should have been sent to -threads.. -------------------------------------------- >Hi list, >> >> I think I've found a possible bug in 4-stable, though I'm not that >> kind of an expert so I'll leave that decision up to you. >> >> Attached is a little test program that opens /dev/cuaa0 and tries to >> read a couple bytes. >> >> When compiled using "gcc vtime.c -o vtime" there's no problem. For >> example, when you run vtime without anything attached to cuaa0, >> it'll wait about 2 seconds and timeout, since VMIN=0 and VTIME=20. >> >> When compiled using "gcc -pthread vtime.c -o vtime" however, the >> read function returns immediately, which as far as I can understand, >> is not what it's supposed to do. >> >> Does anyone know if this intended or not, or how I can get the right >> behaviour in a threaded program? I've done some more testing. It appears that when linked with lc_r, VTIME is completely ignored. As explained in termios(4), when VMIN>0, the read call will wait indefinitely for the first byte and then use VTIME as an interbyte timer. When using lc_r however, it'll return immediately after the first couple bytes read, even if that's less than VMIN. The case where VTIME==0 works as it should both with lc and lc_r. I dont have access to a box with -current, so I can't say if the same applies to it. I hope somebody understands this better or could at least give me a few pointers as to where to look in the source code. Thanks, tijl -------------- next part -------------- #include #include #include #include #include extern int errno; int main(void) { int fd, len; struct termios termset; uint8_t data[256]; fd = open("/dev/cuaa0", O_RDWR | O_FSYNC); printf("%d %d\n", fd, errno); if (fd != -1) { tcgetattr(fd, &termset); cfmakeraw(&termset); cfsetspeed(&termset, B9600); termset.c_cc[VMIN] = 1; termset.c_cc[VTIME] = 0; tcsetattr(fd, TCSANOW, &termset); len = read(fd, (void *) data, 3); printf("%d\n", len); close(fd); } return 0; } From owner-freebsd-threads@FreeBSD.ORG Wed Sep 1 10:48: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 47BF216A4CE for ; Wed, 1 Sep 2004 10:48:11 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AC1143D46 for ; Wed, 1 Sep 2004 10:48:09 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [195.163.185.142] (i2-142.rommon.fi [195.163.185.142]) by silver.he.iki.fi (8.12.10/8.11.4) with ESMTP id i81Am6m1006193 for ; Wed, 1 Sep 2004 13:48:07 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <4135A8E6.4010402@he.iki.fi> Date: Wed, 01 Sep 2004 13:48:06 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: dmalloc and pthread 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, 01 Sep 2004 10:48:11 -0000 Has anyone successfully used dmalloc libarary with pthread without reverting to enabling debugging when main has been executed already with dmalloc_debug_setup? Pete From owner-freebsd-threads@FreeBSD.ORG Wed Sep 1 22:12:52 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 A68E716A4CE; Wed, 1 Sep 2004 22:12:52 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AE5D43D1D; Wed, 1 Sep 2004 22:12:52 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i81MCoFG008278; Wed, 1 Sep 2004 18:12:50 -0400 (EDT) Date: Wed, 1 Sep 2004 18:12:49 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Julian Elischer In-Reply-To: <4134C51A.8010207@vicor.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: threads@freebsd.org cc: freebsd-stable@freebsd.org Subject: Re: 4-stable termios diff behaviour lc/lc_r X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 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 Sep 2004 22:12:52 -0000 On Tue, 31 Aug 2004, Julian Elischer wrote: > > this should have been sent to -threads.. > -------------------------------------------- > >Hi list, > >> > >> I think I've found a possible bug in 4-stable, though I'm not that > >> kind of an expert so I'll leave that decision up to you. > >> > >> Attached is a little test program that opens /dev/cuaa0 and tries to > >> read a couple bytes. > >> > >> When compiled using "gcc vtime.c -o vtime" there's no problem. For > >> example, when you run vtime without anything attached to cuaa0, > >> it'll wait about 2 seconds and timeout, since VMIN=0 and VTIME=20. > >> > >> When compiled using "gcc -pthread vtime.c -o vtime" however, the > >> read function returns immediately, which as far as I can understand, > >> is not what it's supposed to do. > >> > >> Does anyone know if this intended or not, or how I can get the right > >> behaviour in a threaded program? > > > I've done some more testing. It appears that when linked with lc_r, > VTIME is completely ignored. Yes, and it will always be completely ignored. If you want to use libc_r on 4.x, you'll have to work around it (use select() or poll() perhaps). It is not a problem in 5.x which will be the next -stable. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed Sep 1 22:39:42 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 7F9CC16A4CE for ; Wed, 1 Sep 2004 22:39:42 +0000 (GMT) Received: from regina.plastikos.com (plastikos.com [69.38.58.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA6BE43D45 for ; Wed, 1 Sep 2004 22:39:41 +0000 (GMT) (envelope-from fullermd@over-yonder.net) Received: from mortis.over-yonder.net (adsl-222-87-93.jan.bellsouth.net [68.222.87.93]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by regina.plastikos.com (Postfix) with ESMTP id F13566EEEC; Wed, 1 Sep 2004 18:39:40 -0400 (EDT) Received: by mortis.over-yonder.net (Postfix, from userid 100) id 290CF20F7E; Wed, 1 Sep 2004 17:39:38 -0500 (CDT) Date: Wed, 1 Sep 2004 17:39:38 -0500 From: "Matthew D. Fuller" To: Petri Helenius Message-ID: <20040901223938.GT53236@over-yonder.net> References: <4135A8E6.4010402@he.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4135A8E6.4010402@he.iki.fi> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.6i-fullermd.2 cc: freebsd-threads@freebsd.org Subject: Re: dmalloc and pthread 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, 01 Sep 2004 22:39:42 -0000 On Wed, Sep 01, 2004 at 01:48:06PM +0300 I heard the voice of Petri Helenius, and lo! it spake thus: > > Has anyone successfully used dmalloc libarary with pthread without > reverting to enabling debugging when main has been executed already > with dmalloc_debug_setup? Does linking to -ldmallocth not do it? I use it on a few threaded programs, and it seems to work pretty well. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ "The only reason I'm burning my candle at both ends, is because I haven't figured out how to light the middle yet" From owner-freebsd-threads@FreeBSD.ORG Thu Sep 2 06:00:50 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 C6D8F16A4CE for ; Thu, 2 Sep 2004 06:00:50 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4FF343D5A for ; Thu, 2 Sep 2004 06:00:49 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.134] (h86.vuokselantie10.fi [193.64.42.134]) by silver.he.iki.fi (8.12.10/8.11.4) with ESMTP id i8260km1084473; Thu, 2 Sep 2004 09:00:47 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <4136B70F.2070705@he.iki.fi> Date: Thu, 02 Sep 2004 09:00:47 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Matthew D. Fuller" References: <4135A8E6.4010402@he.iki.fi> <20040901223938.GT53236@over-yonder.net> In-Reply-To: <20040901223938.GT53236@over-yonder.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: dmalloc and pthread 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: Thu, 02 Sep 2004 06:00:50 -0000 Matthew D. Fuller wrote: > >Does linking to -ldmallocth not do it? I use it on a few threaded >programs, and it seems to work pretty well. > > > It does but depending on the number of libaries (and possibly other things changing around) one needs to figure out the right number to put on the lockon parameter and if it's too small, it loops until stack space runs out. I was wondering if there is a better way. Pete