You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2011/02/08 11:29:12 UTC

DO NOT REPLY [Bug 50731] New: apr_atomic_casptr has wrong volatile qualifier

https://issues.apache.org/bugzilla/show_bug.cgi?id=50731

           Summary: apr_atomic_casptr has wrong volatile qualifier
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: philip@apache.org


Created an attachment (id=26622)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26622)
apr_atomic_casptr volatile fix

The prototype for apr_atomic_casptr is

APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const
void
 *cmp);

The mem parameter has the wrong volatile qualifier, it is declared as "a
non-volatile pointer to a non-volatile pointer to volatile data" but CAS
operates on the value of the pointer, not on the value of the dereferenced
pointer, so it is the value of the pointer that should be volatile.

The correct prototype is

APR_DECLARE(void*) apr_atomic_casptr(void * volatile *mem, void *with, const
void
 *cmp);

This matches apr_atomic_cas32 where CAS applies to the int32 value and the
corresponding parameter is a "pointer to a volatile int32".

The function apr_atomic_xchgptr has a similar problem.

The attached patch has been tested on 64-bit Linux.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 50731] apr_atomic_casptr has wrong volatile qualifier

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50731

Daniel Shahaf <da...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danielsh@apache.org

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 50731] apr_atomic_casptr has wrong volatile qualifier

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50731

--- Comment #1 from Joe Orton <jo...@redhat.com> 2011-02-08 06:51:43 EST ---
Yes, this is noted in STATUS as one of the API changes needed for 2.0 - I think
it constitutes an API change so we can't really do it in 1.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org