From owner-freebsd-threads@FreeBSD.ORG Tue May 27 14:17:53 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 DDCA237B401 for ; Tue, 27 May 2003 14:17:53 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id A363143F75 for ; Tue, 27 May 2003 14:17:52 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h4RLHok8070389; Wed, 28 May 2003 00:17:50 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <038a01c32495$6a1e17f0$812a40c1@PETEX31> From: "Petri Helenius" To: "Daniel Eischen" References: Date: Wed, 28 May 2003 00:17:43 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-threads@freebsd.org Subject: Re: malloc(): error: recursive call 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, 27 May 2003 21:17:54 -0000 >And what does `ldd libnetsnmp.so.x`, `ldd libfoo.y`, show? They give empty replies. >What is `ldd yourexecutable` show? Itīs usually linked static but if I remove the -static line it says: libnetsnmp.so.5 => /usr/local/lib/libnetsnmp.so.5 (0x2807f000) libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x280fe000) libpcap.so.2 => /usr/lib/libpcap.so.2 (0x28209000) libkse.so.1 => /usr/lib/libkse.so.1 (0x28225000) libc.so.5 => /usr/lib/libc.so.5 (0x28246000) >malloc is thread safe and we've been using it fine >with all our tests. I suspect you're using another >library that is using libc_r or something. malloc works for me with for example linuxthreads. So I do believe that the the trigger for malloc locking works, however looking at the code, spinlocks are implemented differently depending on which thread library is linked in. I have only I686_CPU on my kernel config and I donīt include pthread.h to all object files because itīs not supposed to be neccessary. (only those which call pthread_* functions) The code is compiled on a machine with no SMP and run on both SMP and non-SMP machines. Do I understand correctly that libkse mutexes always require syscall when locking and unlocking? Pete