From owner-freebsd-current@FreeBSD.ORG Wed Mar 11 03:04:58 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA2AE106570D for ; Wed, 11 Mar 2009 03:04:58 +0000 (UTC) (envelope-from justin.teller@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by mx1.freebsd.org (Postfix) with ESMTP id A90588FC1C for ; Wed, 11 Mar 2009 03:04:58 +0000 (UTC) (envelope-from justin.teller@gmail.com) Received: by wf-out-1314.google.com with SMTP id 27so2642587wfd.7 for ; Tue, 10 Mar 2009 20:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=20MOh6jmHshZNc7YfIIQdsvFU5bP+88DzcxAZc1+Ru4=; b=tMH52pXWtMaRQZbDSqsSrNoMGDoOtpiK/tMOLMkYpGfv0CSObugEjWPycjjP4OMpCn lno1oCrW7iNICfB+Sn0+8T0HVtPzZAgaxVj2Nzg7NeQpu2+h5BfkthdNk/F5uLYREP1z VVLI42M9HpWebpx7rZjER8O0GarB6YD/Bxz8E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=w1QpM+AAz1UX5BxUvD5W0JJs8tT6E0PabYswxfHpli79+5y1ml5P9yzXrb90quGu40 Q0yc1zUwpY/C+wpMuZzR1J6IPkwn6qcAbOKVciC7KXxh5giSwiiHdP60cKsDuvuDr8ZL b3uBMJeRt6lp3gpLofe/Xe/j3AvkQuyZEPqfw= MIME-Version: 1.0 Received: by 10.142.135.16 with SMTP id i16mr3435581wfd.192.1236740697723; Tue, 10 Mar 2009 20:04:57 -0700 (PDT) In-Reply-To: <49B61331.4050106@freebsd.org> References: <3561C827-66BD-4B3F-A3D4-97C4C06884B4@gmail.com> <49B61331.4050106@freebsd.org> Date: Tue, 10 Mar 2009 20:04:57 -0700 Message-ID: From: Justin Teller To: David Xu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-current@freebsd.org" Subject: Re: Using PTHREAD_PRIO_INHERIT causes panic in kern_umtx.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2009 03:04:59 -0000 > > When I compile and run the attached program, it panics my system, (FreeBSD >>> CURRENT as of 2-20-09) with the following message: >>> >>> panic: Assertion pi != NULL failed at /usr/src/sys/kern/kern_umtx: 1464 >>> >>> With the backtrace being: >>> Tracing pid 1079 tid 100045 td 0xffffff00037c8000 >>> kdb_enter() at kdb_enter+0x40 >>> panic() at panic+0x1ec >>> umtx_pi_adjust() at umtx_pi_adjust+0xfc8 >>> umtx_pi_adjust() at umtx_pi_adjust+0x19bd >>> _umtx_unlock() at _umtx_unlock+0x2c41 >>> _umtx_op() at _umtx_op+0x22 >>> syscall() at syscall+0x1f4 >>> Xfast_syscall() at Xfast_syscall+0xaa >>> --- syscall (454, FreeBSD ELF64, _umtx_op), rip = 0x4056ac, rsp = >>> 0x7fffffbfef38, rbp = 0x80060b150 --- >>> >>> This problem only shows up when I use PTHREAD_PRIO_INHERIT -- if I change >>> the line for pthread_mutexattr_setprotocol to PTHREAD_PRIO_NONE, then it >>> works fine. I've been trying to trace thru the code to figure out where >>> uq_pi_blocked should be setup, but I'm not too familiar with the code so >>> I >>> haven't found where the problem originates. How can I get >>> PTHREAD_PRIO_INHERIT to work? And even if the change is in user-space, >>> it >>> probably shouldn't be this easy to panic the kernel :-) >>> >>> -Justin >>> >>> > There is a bug about NULL pointer, please try the patch, it also > fixes a possible wake-up race. > > http://people.freebsd.org/%7Edavidxu/patch/kern_umtx_prio.patch > > > David Xu > > That definitely looks like it fixes it for my system -- thanks for the quick response!!