All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Posix mutex unit test fails on git head
Date: Tue, 02 Mar 2010 21:24:25 +0100	[thread overview]
Message-ID: <4B8D73F9.3020309@domain.hid> (raw)
In-Reply-To: <4B8D58F7.80507@domain.hid>

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> Jan Kiszka wrote:
>>>> Jan Kiszka wrote:
>>>>> Gilles,
>>>>>
>>>>> can you (or someone else) confirm this:
>>>>>
>>>>> # mutex-torture-posix
>>>>> simple_wait
>>>>> simple mutex_lock 1: 1 (Operation not permitted)
>>>>>
>>>>> I'm on a x86_64 target (2.6.32.8 with latest I-pipe), Xenomai is
>>>>> unpatched git head.
>>>>>
>>>> Looks like a bug in the test case: We do not wrap sched_setscheduler
>>>> which it uses, and my config does not auto-shadow main. Fix will follow.
>>> The test works here, but fails in cond_signaler, mutex_lock 2, just
>>> checked out v2.5.1 to see if we already had the bug.
>>>
>> Weird. Works for me with this fix:
>>
>> diff --git a/src/testsuite/unit/mutex-torture.c b/src/testsuite/unit/mutex-torture.c
>> index 70bda14..ebdd4f2 100644
>> --- a/src/testsuite/unit/mutex-torture.c
>> +++ b/src/testsuite/unit/mutex-torture.c
>> @@ -657,7 +657,7 @@ int main(void)
>>  	/* Set scheduling parameters for the current process */
>>  #ifdef XENO_POSIX
>>  	sparam.sched_priority = 2;
>> -	sched_setscheduler(0, SCHED_FIFO, &sparam);
>> +	pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam);
>>  #else /* __NATIVE_SKIN__ */
>>  	rt_task_shadow(&main_tid, "main_task", 2, 0);
>>  #endif /* __NATIVE_SKIN__ */
>>
>>
>> # mutex-torture-posix
>> simple_wait
>> recursive_wait
>> errorcheck_wait
>> mode_switch
>> pi_wait
>> lock_stealing
>> lock_stealing mutex_trylock: not supported
>> simple_condwait
>> recursive_condwait
>> cond_signaler, mutex_lock 2 waited 0.854 us
> 
> No, that is a bug. We should have waited 10ms, and we wait less than a us.
> 

Ok. Should be fixed by commit af93ec87f975b387243127090b578d57922b38dc.
The bug was on the same goddamn pass as the one we are trying to fix to
return proper return values to user-space.

-- 
					    Gilles.


  parent reply	other threads:[~2010-03-02 20:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 18:15 [Xenomai-core] Posix mutex unit test fails on git head Jan Kiszka
2010-03-02 18:22 ` Jan Kiszka
2010-03-02 18:24   ` Gilles Chanteperdrix
2010-03-02 18:27     ` Jan Kiszka
2010-03-02 18:29       ` Gilles Chanteperdrix
2010-03-02 18:30         ` Jan Kiszka
2010-03-02 18:34           ` Gilles Chanteperdrix
2010-03-02 20:24         ` Gilles Chanteperdrix [this message]
2010-03-02 21:41           ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B8D73F9.3020309@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.