From owner-freebsd-threads@FreeBSD.ORG Thu Sep 16 19:34: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 EA7D816A4CE for ; Thu, 16 Sep 2004 19:34:11 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AA8C43D53 for ; Thu, 16 Sep 2004 19:34:11 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i8GJY6ML029673; Thu, 16 Sep 2004 15:34:06 -0400 (EDT) Date: Thu, 16 Sep 2004 15:34:01 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: "Bjoern A. Zeeb" In-Reply-To: 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: assert in _lock_acquire ? 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: Thu, 16 Sep 2004 19:34:12 -0000 On Thu, 16 Sep 2004, Bjoern A. Zeeb wrote: > Hi, > > I am using a global mutex to serialize a longer debugging > output amongst threads. As this is only used for internal > debugging builds where I really want to see everything > I do not care about performance etc. Where did you introduce the global mutex? In your application or in libpthread or libc sources? > Recently I ran into problems with that - getting a core dump > at the same place in this debugging function. It takes some > time but I can always reproduce it. > > I have seen this the last weeks with at least HEAD/ULE and since > yesterday with RELENG_5/4BSD. The first debugging log where I can > find it is dated 20040802. At that time the machine must have > been running a 5-CURRENT from around 20040625. > > So I finally built libpthread with > env DEBUG_FLAGS=-g make all > and even linked with libpthread.a instead of using the shared lib. > > Here's the relevant part of the backtrace: > > ------ cut ------- > (gdb) bt full > #0 _lock_acquire (lck=0x38, lu=0x80da034, prio=56) at /u1/src/src/RELENG_5/compile-20040914-1630/lib/libpthread/sys/lock.c:168 > i = 135110708 > lval = 672675788 > __func__ = "_lock_acquire" > #1 0x08076151 in mutex_handoff (curthread=0x80ee000, mutex=0x80d8980) at /u1/src/src/RELENG_5/compile-20040914-1630/lib/libpthread/thread/thr_mutex.c:1586 > kmbx = (struct kse_mailbox *) 0x1 The kse_mailbox has become corrupted. If you are using %gs for anything, that could be the cause. %gs is reserved for the threads libraries. -- Dan Eischen