You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Steve Jiang (JIRA)" <ji...@apache.org> on 2010/05/26 23:29:36 UTC

[jira] Created: (TS-377) InkFreeList and InkAtomicList are not atomic in 64-bit

InkFreeList and InkAtomicList are not atomic in 64-bit
------------------------------------------------------

                 Key: TS-377
                 URL: https://issues.apache.org/jira/browse/TS-377
             Project: Traffic Server
          Issue Type: Bug
          Components: Core
         Environment: x86_64
            Reporter: Steve Jiang


The ABA problem may happen with the atomic operations when pointers are 64 bit.

In ink_queue.h,

  typedef union {
    struct {
      void *pointer;
      int32 version;
    } s;
    int64 data;
  } head_p;

The s struct is > 8 bytes on 64-bit and version is supposed to prevent ABA. If INK_USE_MUTEX_FOR_FREELISTS is not defined the push and pop functions do a cas64 on the .data member, which will not check the version.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (TS-377) InkFreeList and InkAtomicList are not atomic in 64-bit

Posted by "Steve Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Jiang closed TS-377.
--------------------------

    Resolution: Invalid

My mistake, I was looking at an older version of the code.  In trunk there are different macros for FREELIST_POINTER and FREELIST_VERSION that take advantage of address space on x86-64 being 48 bits.

> InkFreeList and InkAtomicList are not atomic in 64-bit
> ------------------------------------------------------
>
>                 Key: TS-377
>                 URL: https://issues.apache.org/jira/browse/TS-377
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>         Environment: x86_64
>            Reporter: Steve Jiang
>
> The ABA problem may happen with the atomic operations when pointers are 64 bit.
> In ink_queue.h,
>   typedef union {
>     struct {
>       void *pointer;
>       int32 version;
>     } s;
>     int64 data;
>   } head_p;
> The s struct is > 8 bytes on 64-bit and version is supposed to prevent ABA. If INK_USE_MUTEX_FOR_FREELISTS is not defined the push and pop functions do a cas64 on the .data member, which will not check the version.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.