From owner-freebsd-threads@FreeBSD.ORG Mon Apr 29 11:06:53 2013 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 21D0340C for ; Mon, 29 Apr 2013 11:06:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 129AC1936 for ; Mon, 29 Apr 2013 11:06:53 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TB6qLH018299 for ; Mon, 29 Apr 2013 11:06:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r3TB6qDg018297 for freebsd-threads@FreeBSD.org; Mon, 29 Apr 2013 11:06:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 29 Apr 2013 11:06:52 GMT Message-Id: <201304291106.r3TB6qDg018297@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 Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 11:06:53 -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/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/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash 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/30464 threads [patch] pthread mutex attributes -- pshared 17 problems total. From owner-freebsd-threads@FreeBSD.ORG Sat May 4 11:29:45 2013 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 354C63C8 for ; Sat, 4 May 2013 11:29:45 +0000 (UTC) (envelope-from radiomlodychbandytow@o2.pl) Received: from moh3-ve1.go2.pl (moh3-ve1.go2.pl [193.17.41.30]) by mx1.freebsd.org (Postfix) with ESMTP id EE4911242 for ; Sat, 4 May 2013 11:29:44 +0000 (UTC) Received: from moh3-ve1.go2.pl (unknown [10.0.0.117]) by moh3-ve1.go2.pl (Postfix) with ESMTP id BBA47A6A026 for ; Sat, 4 May 2013 13:29:43 +0200 (CEST) Received: from unknown (unknown [10.0.0.108]) by moh3-ve1.go2.pl (Postfix) with SMTP for ; Sat, 4 May 2013 13:29:43 +0200 (CEST) Received: from unknown [93.175.66.185] by poczta.o2.pl with ESMTP id nptnfK; Sat, 04 May 2013 13:29:43 +0200 Message-ID: <5184F113.805@o2.pl> Date: Sat, 04 May 2013 13:29:23 +0200 From: =?UTF-8?B?UmFkaW8gbcWCb2R5Y2ggYmFuZHl0w7N3?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130407 Thunderbird/17.0.5 MIME-Version: 1.0 To: freebsd-threads@freebsd.org Subject: Getting ENOMEM with pthread_mutex_init Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-O2-Trust: 1, 37 X-O2-SPF: neutral X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:29:45 -0000 Hello, I'm having troubles that I seem unable to resolve. My programs creates and destroys mutexes repeatably (and, obviously, uses them in between). Around the 60th lock created, I always get ENOMEM. I have free memory, lots of it. All locks get released properly. The relevant pieces of code: #define MUTEX pthread_mutex_t inline MUTEX create_mutex() { MUTEX mutex; int ret = pthread_mutex_init(&mutex, NULL); if(ret != 0) throw std::runtime_error("Failed to create a mutex"); return mutex; } inline void destroy_mutex(MUTEX *mutex) { int ret = pthread_mutex_destroy(mutex); if(ret != 0) throw std::runtime_error("Failed to destroy a mutex"); } Scheduler::Scheduler(char* in, char* out, BlockInfo* metadata, size_t isize, size_t block_size, size_t iters, size_t min_work_size) : in(in), current_in(in), out(out), current_out(out), metadata(metadata), current_metadata(metadata), size(isize), size_left(isize), block_size(block_size), iters_left(iters) { lock = create_mutex(); work_size = (min_work_size / block_size) * block_size; if (work_size < min_work_size) work_size += block_size; } Scheduler::~Scheduler() { destroy_mutex(&lock); } Any suggestions? -- Twoje radio