From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 12 17:39:26 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91DD81065672 for ; Mon, 12 Jan 2009 17:39:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-gx0-f15.google.com (mail-gx0-f15.google.com [209.85.217.15]) by mx1.freebsd.org (Postfix) with ESMTP id A49BB8FC12 for ; Mon, 12 Jan 2009 17:39:21 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by gxk8 with SMTP id 8so9187826gxk.7 for ; Mon, 12 Jan 2009 09:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=W1BnLc0oFBU5n8Oizdl1dY7Ct+1Y42+dEAaFXl1XAnk=; b=aH1lWFa35i2uI8rAOrHyJaGRKdciHJmnqisMPicL4Dn8TzgJ++nvWWWRo8Dzy7ZRF3 ZJKeljdVdy4AfUoCUYctiUfo4euEOl12TX3q0xoJOHz4s1/5BvE5Mpy3mUzQomUTdoQ5 MOgTiCBMAZ1DbAR3i2nmnQVpLT7ni25ShWrp4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ZZG8oz9dKmb+r/RmAnvd37np760hEwzJu32owzT15gR3VHLmretXpGfOZkaiM2OBJ3 Pq/icsvPg4jvbxcN6jsfZSKUYUca7l8fS1vF7vZZe2BgMGVrG06dPjaUcuZ8BP9no1Ow 1Lc8scVWq3MMNUhonPiLQohjmDbOlp5bWnGMw= Received: by 10.150.226.15 with SMTP id y15mr10751207ybg.99.1231781953266; Mon, 12 Jan 2009 09:39:13 -0800 (PST) Received: from gmail.com (sdferwer192.net.autocom.pl [77.236.1.49]) by mx.google.com with ESMTPS id e11sm12019516fga.12.2009.01.12.09.39.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Jan 2009 09:39:12 -0800 (PST) Date: Mon, 12 Jan 2009 18:39:13 +0100 From: Mateusz Guzik To: Alexej Sokolov Message-ID: <20090112173913.GA2102@skucha> References: <20090112134726.GA2988@debian.samsung.router> <20090112141029.GA31108@skucha> <671bb5fc0901120819q65969961v723807bcb7ad5a96@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <671bb5fc0901120819q65969961v723807bcb7ad5a96@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: panic by unlocking of mutex in KLD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:39:26 -0000 On Mon, Jan 12, 2009 at 05:19:56PM +0100, Alexej Sokolov wrote: > 2009/1/12 Mateusz Guzik > > Mutexes have owners. It panics on loading because processes cannot > > return to userland with locks held. > > i am not sure about it. Some time ago i implemented a charecter device with > two syscalls: write, read. "write" lock the mutex and "read" unlock it. The > user space programm opens device, then mekes "write" (mutex will held in > kernel), goes back to user space, then makes "read" (mutex will unlocked in > kernel) and it all run without panic. If needed i can post the source code. > Do you have kernel compiled with WITNESS? At least on -CURRENT the kernel panicked like this (while loading your module): System call kldload returning with 1 locks held -- Mateusz Guzik