From owner-freebsd-threads@FreeBSD.ORG Thu Jul 31 20:16:41 2003 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 34A9437B401 for ; Thu, 31 Jul 2003 20:16:41 -0700 (PDT) Received: from ns.aratech.co.kr (ns.aratech.co.kr [61.34.11.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A1E243FE0 for ; Thu, 31 Jul 2003 20:16:40 -0700 (PDT) (envelope-from tj@atj.dyndns.org) Received: from tj.aratech.co.kr ([61.34.11.212] helo=atj.dyndns.org ident=mail) by ns.aratech.co.kr with esmtp (Exim 3.36 #1 (Debian)) id 19iQPF-0004FL-00 for ; Fri, 01 Aug 2003 12:16:37 +0900 Received: from tj by atj.dyndns.org with local (Exim 4.20) id 19iQPk-0000Ym-SY for freebsd-threads@freebsd.org; Fri, 01 Aug 2003 12:17:08 +0900 Date: Fri, 1 Aug 2003 12:17:08 +0900 To: freebsd-threads@freebsd.org Message-ID: <20030801031708.GA2128@atj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i From: TeJun Huh Subject: And problems regarding -lthr (1:1 KSE) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: tejun@aratech.co.kr List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 03:16:41 -0000 I forgot to mention about -lthr (1:1 KSE threading) related problems. 1. If the program is compiled with '-static -lthr', the program crashes at the first thread creation. Stack trace follows. (gdb) bt full #0 0x0804da8c in _spinlock_pthread (pthread=0x0, lck=0x805c3f8) at umtx.h:59 No locals. #1 0x0804da2a in _spinlock (lck=0x805c3f8) at /usr/src/lib/libthr/thread/thr_spinlock.c:69 No locals. #2 0x08058344 in malloc () No symbol table info available. #3 0x080483f9 in _pthread_create (thread=0x0, attr=0x3a0, start_routine=0, arg=0x0) at /usr/src/lib/libthr/thread/thr_create.c:80 f_gc = 928 ret = 0 gc_thread = (struct pthread *) 0x0 new_thread = (struct pthread *) 0x2c pattr = (struct pthread_attr *) 0x80487a8 flags = 0 stack = (void *) 0x805c3f8 #4 0x0804835b in main (argc=2, argv=0xbfbffb40) at testpthread.c:50 stack = (void *) 0x8062000 thr = (struct pthread *) 0x0 attr = (struct pthread_attr *) 0x806a000 ts1sec = {tv_sec = 1, tv_nsec = 0} nr = 10 i = 0 #5 0x08048145 in _start () 2. Without -static, the program works fine, but pthread_create() fails with EAGAIN at thread count 110. B.T.W. pthread_create() return value handling was wrong in the example program. It always confuses me. :-( How can I increase this limit? Again, I'm looking for something like ten thousands.