From owner-freebsd-threads@FreeBSD.ORG Mon Jul 9 11:07:22 2012 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87477106566C for ; Mon, 9 Jul 2012 11:07:22 +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 57EA08FC0C for ; Mon, 9 Jul 2012 11:07:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q69B7MLP075582 for ; Mon, 9 Jul 2012 11:07:22 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q69B7LiU075580 for freebsd-threads@FreeBSD.org; Mon, 9 Jul 2012 11:07:21 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 9 Jul 2012 11:07:21 GMT Message-Id: <201207091107.q69B7LiU075580@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, 09 Jul 2012 11:07:22 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o threa/168417 threads pthread_getcpuclockid() does not work to specification o threa/165173 threads [build] clang buildworld breaks libthr o threa/163512 threads libc defaults to single threaded o threa/160708 threads possible security problem with RLIMIT_VMEM o threa/150959 threads [libc] Stub pthread_once in libc should call _libc_onc o threa/148515 threads Memory / syslog strangeness in FreeBSD 8.x ( possible o threa/141721 threads rtprio(1): (id|rt)prio priority resets when new thread o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 o threa/128922 threads threads hang with xorg running o threa/122923 threads 'nice' does not prevent background process from steali o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/101323 threads [patch] fork(2) in threaded programs broken. o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/79683 threads svctcp_create() fails if multiple threads call at the s threa/76694 threads fork cause hang in dup()/close() function in child (-l s threa/30464 threads [patch] pthread mutex attributes -- pshared 21 problems total. From owner-freebsd-threads@FreeBSD.ORG Thu Jul 12 08:00:19 2012 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 373D9106566C for ; Thu, 12 Jul 2012 08:00:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 09EEB8FC1C for ; Thu, 12 Jul 2012 08:00:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6C80Ise073893 for ; Thu, 12 Jul 2012 08:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6C80ISC073892; Thu, 12 Jul 2012 08:00:18 GMT (envelope-from gnats) Date: Thu, 12 Jul 2012 08:00:18 GMT Message-Id: <201207120800.q6C80ISC073892@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 08:00:19 -0000 The following reply was made to PR threads/168417; it has been noted by GNATS. From: David Xu To: bug-followup@freebsd.org, chris.hall@highwayman.com Cc: Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification Date: Thu, 12 Jul 2012 15:51:02 +0800 I have worked out a patch trying to fix the problem: http://people.freebsd.org/~davidxu/patch/cputime_clockid.diff Regards, David Xu From owner-freebsd-threads@FreeBSD.ORG Fri Jul 13 21:05:49 2012 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 103FC106564A; Fri, 13 Jul 2012 21:05:49 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 9CADF8FC08; Fri, 13 Jul 2012 21:05:48 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id B91963592D9; Fri, 13 Jul 2012 23:05:47 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 91E6D2847B; Fri, 13 Jul 2012 23:05:47 +0200 (CEST) Date: Fri, 13 Jul 2012 23:05:47 +0200 From: Jilles Tjoelker To: David Xu Message-ID: <20120713210547.GA67646@stack.nl> References: <201207120800.q6C80ISC073892@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207120800.q6C80ISC073892@freefall.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-threads@FreeBSD.org Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification 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: Fri, 13 Jul 2012 21:05:49 -0000 On Thu, Jul 12, 2012 at 08:00:18AM +0000, David Xu wrote: > The following reply was made to PR threads/168417; it has been noted > by GNATS. > From: David Xu > To: bug-followup@freebsd.org, chris.hall@highwayman.com > Cc: > Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification > Date: Thu, 12 Jul 2012 15:51:02 +0800 > I have worked out a patch trying to fix the problem: > http://people.freebsd.org/~davidxu/patch/cputime_clockid.diff Some comments: * Should clock_getcpuclockid() and clock_getthreadcpuclockid() be syscalls or can the 2**31 reserved clock ids be hard-coded into libc just like the other clock ids are? * Perhaps clock_getcpuclockid() should check if the pid is valid. * I think p_canwait() is not the right permission check. The p_canwait() check is for wait4() and takes into account that denying at that point completely breaks the process's tracking of its child processes. The right permission check is probably p_cansee() because that's what the kern.proc.* sysctls that return CPU time also check. The recently added pget() function can perform pfind() and p_cansee() in one call. * Why can a thread's CPU clock only be read from the same process? The kern.proc.* sysctls allow querying any thread whose process you p_cansee. However, the POSIX APIs only allow accessing threads within the process because there is no pthread_t for other threads. -- Jilles Tjoelker From owner-freebsd-threads@FreeBSD.ORG Fri Jul 13 23:43:08 2012 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 41792106566C; Fri, 13 Jul 2012 23:43:08 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 115DE8FC0A; Fri, 13 Jul 2012 23:43:08 +0000 (UTC) Received: from xp5k.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6DNh6jI074641; Fri, 13 Jul 2012 23:43:07 GMT (envelope-from listlog2011@gmail.com) Message-ID: <5000B280.3040107@gmail.com> Date: Sat, 14 Jul 2012 07:42:56 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jilles Tjoelker References: <201207120800.q6C80ISC073892@freefall.freebsd.org> <20120713210547.GA67646@stack.nl> In-Reply-To: <20120713210547.GA67646@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Xu , freebsd-threads@freebsd.org Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 23:43:08 -0000 On 2012/07/14 05:05, Jilles Tjoelker wrote: > On Thu, Jul 12, 2012 at 08:00:18AM +0000, David Xu wrote: >> The following reply was made to PR threads/168417; it has been noted >> by GNATS. >> From: David Xu >> To: bug-followup@freebsd.org, chris.hall@highwayman.com >> Cc: >> Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification >> Date: Thu, 12 Jul 2012 15:51:02 +0800 >> I have worked out a patch trying to fix the problem: >> http://people.freebsd.org/~davidxu/patch/cputime_clockid.diff > Some comments: > > * Should clock_getcpuclockid() and clock_getthreadcpuclockid() be > syscalls or can the 2**31 reserved clock ids be hard-coded into libc > just like the other clock ids are? why should I hard-code it ? is syscall so horrible ? why can't you cache the thread's clock id if you want to frequently access it? it is not gettimeofday which returns different value each time. If it is hard-coded, how do I check if the pid is valid or I have permission to get its CPU time? should clock_getcpuclockid always return successfully ? > * Perhaps clock_getcpuclockid() should check if the pid is valid. Yes > * I think p_canwait() is not the right permission check. The p_canwait() > check is for wait4() and takes into account that denying at that point > completely breaks the process's tracking of its child processes. The > right permission check is probably p_cansee() because that's what the > kern.proc.* sysctls that return CPU time also check. The recently > added pget() function can perform pfind() and p_cansee() in one call. Yes, p_cansee seems to be more wide, while p_canwait has better granularity, it does seem not very right. > * Why can a thread's CPU clock only be read from the same process? The > kern.proc.* sysctls allow querying any thread whose process you > p_cansee. However, the POSIX APIs only allow accessing threads within > the process because there is no pthread_t for other threads. At the time, I am only programming for POSIX, and thread can not be seen by other processes. From owner-freebsd-threads@FreeBSD.ORG Sat Jul 14 00:07:54 2012 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE6E4106566C; Sat, 14 Jul 2012 00:07:54 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9EA528FC14; Sat, 14 Jul 2012 00:07:54 +0000 (UTC) Received: from xp5k.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6E07rW1076898; Sat, 14 Jul 2012 00:07:53 GMT (envelope-from listlog2011@gmail.com) Message-ID: <5000B84F.2090903@gmail.com> Date: Sat, 14 Jul 2012 08:07:43 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: davidxu@freebsd.org References: <201207120800.q6C80ISC073892@freefall.freebsd.org> <20120713210547.GA67646@stack.nl> <5000B280.3040107@gmail.com> In-Reply-To: <5000B280.3040107@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-threads@freebsd.org Subject: Re: threads/168417: pthread_getcpuclockid() does not work to specification X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 00:07:54 -0000 On 2012/07/14 07:42, David Xu wrote: > On 2012/07/14 05:05, Jilles Tjoelker wrote: >> On Thu, Jul 12, 2012 at 08:00:18AM +0000, David Xu wrote: >>> The following reply was made to PR threads/168417; it has been noted >>> by GNATS. >>> From: David Xu >>> To: bug-followup@freebsd.org, chris.hall@highwayman.com >>> Cc: >>> Subject: Re: threads/168417: pthread_getcpuclockid() does not work >>> to specification >>> Date: Thu, 12 Jul 2012 15:51:02 +0800 >>> I have worked out a patch trying to fix the problem: >>> http://people.freebsd.org/~davidxu/patch/cputime_clockid.diff >> Some comments: I have updated it: http://people.freebsd.org/~davidxu/patch/cputime_clockid2.diff