Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-1066

SPARCV8 requires pthread_mutex_t and pthread_cond_t to be aligned on an 8-byte boundary



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.2.1, 4.2.2, 4.2.x, 4.3.x
    • Fix Version/s: 4.2.2, 4.2.x, 4.3.x
    • Component/s: Thread Safety
    • Environment:

      Solaris 10 Update 6 or later on SPARCV8 [32-bit]
      Defect is compiler-independent - in reality it only affects Sun Studio and GCC.

    • Regression:
      Unit Test Broken
    • Severity:
      Incorrect Behavior


      Starting with Solaris 10 Update 6, on SPARCV8, pthread_mutex_t and pthread_cond_t MUST be aligned on an 8-byte boundary. Misaligned access will result in either SEGV or SIGBUS.

      There are numerous places in the multi-threaded version of stdcxx where pthread_mutex_t and/or pthread_cond_t types are contained within an union, but with an enforced alignment different than 8. All these instances must be corrected, and #ifdef-guarded for SPARCV8.

      Patches to follow shortly, this is just opening the issue.

      Warning: the patchset resolving this issue is very large, and it affects a large number of files.


        1. use_facet.h.stdcxx-1066.patch
          3 kB
          Stefan Teleman
        2. time_put.cpp.stdcxx-1066.patch
          1.0 kB
          Stefan Teleman
        3. _mutex.h.stdcxx-1066.patch
          4 kB
          Stefan Teleman
        4. messages.cpp.stdcxx-1066.patch
          1 kB
          Stefan Teleman
        5. locale_classic.cpp.stdcxx-1066.patch
          1 kB
          Stefan Teleman
        6. locale_body.cpp.stdcxx-1066.patch
          2 kB
          Stefan Teleman
        7. iostream.stdcxx-1066.patch
          0.5 kB
          Stefan Teleman
        8. iostream.cpp.stdcxx-1066.patch
          1 kB
          Stefan Teleman
        9. ios.cpp.stdcxx-1066.patch
          1 kB
          Stefan Teleman
        10. exception.cpp.stdcxx-1066.patch
          0.8 kB
          Stefan Teleman
        11. ctype.cpp.stdcxx-1066.patch
          0.9 kB
          Stefan Teleman
        12. _config-sunpro.h.stdcxx-1066.patch
          0.7 kB
          Stefan Teleman
        13. _config-gcc.h.stdcxx-1066.patch
          0.8 kB
          Stefan Teleman

          Issue Links



              • Assignee:
                steleman Stefan Teleman
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: