Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSH pthread_cond_timedwait()

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Defect in XSH pthread_cond_timedwait()
From: "Alexander Terekhov" <yyyyyyyy@xxxxxxxxxx>
Date: Fri, 23 Aug 2002 00:12:43 +0200
>            Defect report from : Ulrich Drepper , Red Hat, Inc.
[...]
> - the recognition of an invalid abstime parameter must not be optional.
>   It isn't anywhere else.

Uhmm.

"....
 The pthread_rwlock_timedwrlock() function shall fail if:

   [ETIMEDOUT]
       The lock could not be acquired before the specified timeout
       expired.

 The pthread_rwlock_timedwrlock() function may fail if:

   [EDEADLK]
       The calling thread already holds the rwlock.

   [EINVAL]
       The value specified by rwlock does not refer to an initialized
       read-write lock object, or the abs_timeout nanosecond value is
       less than zero or greater than or equal to 1000 million.

 ...."

"....
 The pthread_rwlock_timedrdlock() function shall fail if:

   [ETIMEDOUT]
        The lock could not be acquired before the specified timeout
        expired.

 The pthread_rwlock_timedrdlock() function may fail if:

   [EAGAIN]
        The read lock could not be acquired because the maximum number
        of read locks for lock would be exceeded.

   [EDEADLK]
        The calling thread already holds a write lock on rwlock.

   [EINVAL]
        The value specified by rwlock does not refer to an initialized
        read-write lock object, or the abs_timeout nanosecond value is
        less than zero or greater than or equal to 1000 million.

...."

regards,
alexander.


yyyyyyy@xxxxxxxxxx on 08/22/2002 09:17:11 PM

Please respond to yyyyyyy@xxxxxxxxxx

To:    yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
cc:
Subject:    Defect in XSH pthread_cond_timedwait()


             Defect report from : Ulrich Drepper , Red Hat, Inc.

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 1033 line 32522 section pthread_cond_timedwait() objection {ud-cv-1}

Problem:

Defect code :  1. Error

The error section for pthread_cond_tiemdwait() and pthread_cond_wait()
currently says:

32518 ERRORS

32519 The pthread_cond_timedwait( ) function shall fail if:
32520 [ETIMEDOUT] The time specified by abstime to
                  pthread_cond_timedwait( ) has passed.

32521 The pthread_cond_timedwait( ) and pthread_cond_wait( ) functions may
fail if:

32522 [EINVAL] The value specified by cond, mutex, or abstime is
               invalid.

There are a number of things wrong:

- pthread_cond_wait() has no abstime parameter;

- the recognition of an invalid abstime parameter must not be optional.
  It isn't anywhere else.

Action:

Change the beginning of the ERRORS section above to:

ERRORS

The pthread_cond_timedwait( ) function shall fail if:
  [ETIMEDOUT] The time specified by abstime to
              pthread_cond_timedwait( ) has passed.

  [EINVAL] The value specified by abstime is invalid.

The pthread_cond_timedwait( ) and pthread_cond_wait( ) functions may fail
if:

  [EINVAL] The value specified by cond or mutex is invalid.


I.e., create an [EINVAL] case in the "shall" section.





<Prev in Thread] Current Thread [Next in Thread>