Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2009 15:13:53 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Justin Teller <justin.teller@gmail.com>
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: Using PTHREAD_PRIO_INHERIT causes panic in kern_umtx.c
Message-ID:  <49B61331.4050106@freebsd.org>
In-Reply-To: <c47019cc0903091355q2273d1fft715cd47cedab1d3d@mail.gmail.com>
References:  <3561C827-66BD-4B3F-A3D4-97C4C06884B4@gmail.com> <c47019cc0903091355q2273d1fft715cd47cedab1d3d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Justin Teller wrote:
> On Mon, Mar 9, 2009 at 12:02 PM, Justin Teller <justin.teller@gmail.com>wrote:
> 
>> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49B61331.4050106>