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



    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 4.2.1, 4.2.2, 4.2.x, 4.3.x
    • 4.2.2, 4.2.x, 4.3.x
    • Thread Safety
    • Solaris 10 Update 6 or later on SPARCV8 [32-bit]
      Defect is compiler-independent - in reality it only affects Sun Studio and GCC.

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

        Issue Links



              Unassigned Unassigned
              steleman Stefan Teleman
              0 Vote for this issue
              2 Start watching this issue