|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 2094 Details Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 2094.
Report 2094 Actions
Problem Report Number 2094 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.1065 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published null Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98) Certification Program The Open Brand certification program Test Suite VSTH version 5.2.1 Test Identification PTHR.os/mutex/pthread_mutex_unlock 9 Problem Summary TSD5TH.00085 The assertions exit with a SIGABRT because in both tests, a thread attempts to unlock a lock it does not own. Code for pthread_mutex_unlock, 3 parts (start, test, end): int t9_sfunc() { int rval; rval... Problem Text
The assertions exit with a SIGABRT because in both tests, a
thread attempts to unlock a lock it does not own.
Code for pthread_mutex_unlock, 3 parts (start, test, end):
int
t9_sfunc()
{
int rval;
rval = pthread_mutex_init( &T9_mx, NULL );
rval += pthread_mutex_lock( &T9_mx );
return(rval);
}
int
t9_tfunc()
{
int val;
int rval;
rval = 1;
val = pthread_mutex_unlock( &T9_mx );
if ( val != EINTR )
rval = 0;
return(rval);
}
int
t9_efunc()
{
(void) pthread_mutex_unlock( &T9_mx );
(void) pthread_mutex_destroy( &T9_mx );
return(0);
}
It locks the mutex in the start function, tries to unlock it in
the test function, then for cleanup it calls unlock again. However
this second time it no longer has the mutex locked.
>From description of pthread_mutex_unlock in System Interfaces and
Headers, Issue 5:
"If a thread attempts to unlock a mutex that it has not locked or
a mutex which is unlocked, undefined behavior results."
Code for pthread_rwlock_unlock, again 3 parts:
int
t7_sfunc()
{
int rval;
rval = pthread_rwlock_init( &T7_rwl, NULL );
if ( rval == 0 )
{
rval = pthread_rwlock_rdlock( &T7_rwl );
}
return(rval);
}
int
t7_tfunc()
{
int val;
int rval;
rval = 1;
val = pthread_rwlock_unlock( &T7_rwl );
if ( val != EINTR )
rval = 0;
return(rval);
}
int
t7_efunc()
{
(void) pthread_rwlock_unlock( &T7_rwl );
(void) pthread_rwlock_destroy( &T7_rwl );
return(0);
}
In the start function, it locks rwlock for reading. In the test
function it unlocks rwlock. And again in the cleanup it calls
unlock. Since this is a reader lock, it is possible to call unlock
more than once, each call decrementing the lock counter. However,
in this case the counter was 1, decremented to 0, and then unlock
was called again.
>From description of pthread_rwlock_unlock in System Inferfaces and
Headers, Issue 5:
"Results are undefined if the read-write lock rwlock is not held
by the calling thread."Test Output
******************************************************************************************
/tset/PTHR.os/mutex/pthread_mutex_unlock/T.pthread_mutex_unlock 9 UNREPORTED
Test Information:
A call to pthread_mutex_unlock() shall not return EINTR.
Posix Ref: Component PTHREAD_MUTEX_UNLOCK
Assertion 9945-1:1996 2.4-9(A)
******************************************************************************************
******************************************************************************************
/tset/PTHR.os/rwlock/pthread_rwlock_unlock/T.pthread_rwlock_unlock 7 UNREPORTED
Test Information:
A call to pthread_rwlock_unlock() shall return EINTR.
Posix Ref: Component PTHREAD_RWLOCK_UNLOCK
Assertion 9945-1:1996 2.4-7(A)
******************************************************************************************Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
A test suite deficiency is recommended.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
Problem Reporting System Options:
- View Report 2094
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority