* [LTP] Query regarding Open Posix Test Case failure (pthread_rwlock_rdlock)
@ 2012-03-19 8:11 Jubi Taneja
2012-03-20 8:30 ` Kang Kai
0 siblings, 1 reply; 4+ messages in thread
From: Jubi Taneja @ 2012-03-19 8:11 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 845 bytes --]
Hi
In LTP(Jan 2012 release) Open Posix Test Suite, the test case
"pthread_rwlock_rdlock/2-1.c"
fails for Linux Kernel 3.0.18 for target ARM.
The exact output of the program is:
main: has priority: 3
main: attempt read lock
main: acquired read lock
main: create wr_thread, with priority: 2
wr_thread: attempt write lock
main: create rd_thread, with priority: 1
rd_thread: attempt read lock
rd_thread: acquired read lock
rd_thread: unlock read lock
Test FAILED: rd_thread did not block on read lock, when a reader owns the
lock, and a higher
priority writer is waiting for the lock
The path of the program si :
VDLTP_20120104/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock
Ca anyone please explain why it fails at this point? I am unable to catch
the exact reason.
Looking forward to your reply.
Thanks,
Jubi
[-- Attachment #1.2: Type: text/html, Size: 966 bytes --]
[-- Attachment #2: Type: text/plain, Size: 191 bytes --]
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] Query regarding Open Posix Test Case failure (pthread_rwlock_rdlock)
2012-03-19 8:11 [LTP] Query regarding Open Posix Test Case failure (pthread_rwlock_rdlock) Jubi Taneja
@ 2012-03-20 8:30 ` Kang Kai
2012-03-20 8:48 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Kang Kai @ 2012-03-20 8:30 UTC (permalink / raw)
To: Jubi Taneja; +Cc: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 1769 bytes --]
On 2012?03?19? 16:11, Jubi Taneja wrote:
> Hi
>
> In LTP(Jan 2012 release) Open Posix Test Suite, the test case
> "pthread_rwlock_rdlock/2-1.c"
> fails for Linux Kernel 3.0.18 for target ARM.
>
>
> The exact output of the program is:
> main: has priority: 3
> main: attempt read lock
> main: acquired read lock
> main: create wr_thread, with priority: 2
> wr_thread: attempt write lock
> main: create rd_thread, with priority: 1
> rd_thread: attempt read lock
> rd_thread: acquired read lock
> rd_thread: unlock read lock
> Test FAILED: rd_thread did not block on read lock, when a reader owns
> the lock, and a higher
> priority writer is waiting for the lock
Hi Jubi,
I am using eglibc and meet the same failure. My analysis is that
This test case is to test option *Thread Execution Scheduling* of
pthread rwlock.
But eglibc/libc don't support this option. They provide a
rwlock->__data.*__flags* option to identify
perfer 'read lock' or write lock, and the default is 'read lock'
first. So second reader can get the lock
when a higher priority writer is waiting for the lock.
Regards,
Kai
>
>
>
> The path of the program si :
> VDLTP_20120104/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock
>
> Ca anyone please explain why it fails at this point? I am unable to
> catch the exact reason.
>
> Looking forward to your reply.
>
> Thanks,
> Jubi
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
[-- Attachment #1.2: Type: text/html, Size: 3175 bytes --]
[-- Attachment #2: Type: text/plain, Size: 191 bytes --]
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] Query regarding Open Posix Test Case failure (pthread_rwlock_rdlock)
2012-03-20 8:30 ` Kang Kai
@ 2012-03-20 8:48 ` Wanlong Gao
2012-05-02 13:45 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Wanlong Gao @ 2012-03-20 8:48 UTC (permalink / raw)
To: Kang Kai, Jubi Taneja; +Cc: ltp-list
On 03/20/2012 04:30 PM, Kang Kai wrote:
> On 2012年03月19日 16:11, Jubi Taneja wrote:
>> Hi
>>
>> In LTP(Jan 2012 release) Open Posix Test Suite, the test case "pthread_rwlock_rdlock/2-1.c"
>> fails for Linux Kernel 3.0.18 for target ARM.
>>
>>
>> The exact output of the program is:
>> main: has priority: 3
>> main: attempt read lock
>> main: acquired read lock
>> main: create wr_thread, with priority: 2
>> wr_thread: attempt write lock
>> main: create rd_thread, with priority: 1
>> rd_thread: attempt read lock
>> rd_thread: acquired read lock
>> rd_thread: unlock read lock
>> Test FAILED: rd_thread did not block on read lock, when a reader owns the lock, and a higher
>> priority writer is waiting for the lock
>
> Hi Jubi,
>
> I am using eglibc and meet the same failure. My analysis is that
>
> This test case is to test option *Thread Execution Scheduling* of pthread rwlock.
> But eglibc/libc don't support this option. They provide a rwlock->__data.*__flags* option to identify
> perfer 'read lock' or write lock, and the default is 'read lock' first. So second reader can get the lock
> when a higher priority writer is waiting for the lock.
This's a glibc's bug.
POSIX said: "If the Thread Execution Scheduling option is supported, and the threads involved in the lock are executing with the scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock; otherwise, the calling thread shall acquire the lock."
But at glibc, reader always acquire rwlock if there's not a writer held this lock. so test fail.
Thanks,
Wanlong Gao
>
> Regards,
> Kai
>
>>
>>
>>
>> The path of the program si :
>> VDLTP_20120104/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock
>>
>> Ca anyone please explain why it fails at this point? I am unable to catch the exact reason.
>>
>> Looking forward to your reply.
>>
>> Thanks,
>> Jubi
>>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>>
>>
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
>
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-02 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 8:11 [LTP] Query regarding Open Posix Test Case failure (pthread_rwlock_rdlock) Jubi Taneja
2012-03-20 8:30 ` Kang Kai
2012-03-20 8:48 ` Wanlong Gao
2012-05-02 13:45 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox