IBM Support

PH62468: NEW FUNCTION - Additional Support for C/C++ Thread Local Storage

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as new function.

Error description

  • NEW FUNCTION
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of C/C++ Thread Local Storage (TLS)    *
    ****************************************************************
    * PROBLEM DESCRIPTION: A C or C++ program that uses thread     *
    *                      local storage and initializes a thread  *
    *                      local variable to the address of global *
    *                      variable cannot be built successfully.  *
    *                      The compile with the Open XL C/C++ 2.1  *
    *                      compiler will be successful, but the    *
    *                      bind will fail with error message       *
    *                      IEW2353E.                               *
    ****************************************************************
    See problem description.
    

Problem conclusion

Temporary fix

Comments

  • Additional Support for C/C++ Thread Local Storage (TLS).
    - Allow initialization of a thread local storage variable to
      the address of a global (WSA) variable
    
    The following publication must be updated.
    ================================================================
    z/OS Language Environment Vendor Interfaces (SA38-0688)
    In part Language Environment vendor interfaces for AMODE 64
    applications
    In chapter Storage management for AMODE 64 applications
    In section __tls_get_addr() - Compiler-writer interface in
    support of thread-local variables
    Replace the Syntax section with the following:
    #include <__le_cwi.h>
    
    void __tls_get_addr(tls_index_t *ti);
    
    typedef struct
    {
      unsigned long int   *ti_module;
      unsigned long int    ti_offset;
    }tls_index_t;
    
    Replace the description of the parameters with the following:
    ti(input)
    The address of a tls_index_t which contains the identity
    information of one thread local storage (TLS) variable.
    The tls_index_t has two fields which are used differently
    depending on which method is used to allocate the TLS template:
    
      ti_module
      The 8-byte address of an 8-byte field which identifies a
      module.
      New method:
        The address of field @@TLS@MOD@ID in class C_WSA64.
      Old method:
        The address of field @@TLS@MODULEID in class C_WSA64.
    
      ti_offset
      An 8-byte offset for the TLS variable from the beginning
      of the TLS template.
      New method:
        The offset from variable @@TLS@BEGIN in class C_WSA64.
      Old method:
        The offset from the beginning of class C_TLS64.
    
    Add the following Usage Note:
    When a module that uses thread local storage (TLS) is loaded,
    a TLS template (an image of what the TLS looks like) is
    allocated. This TLS template is copied when TLS is allocated
    for a thread.
    
    There are two methods which are used to create a TLS template.
    
    The new and preferred method:
    - A TLS variable can be initialized to the address of
      a writable static variable using this method.
    - Define fields for TLS variables in the class C_WSA64
      with priority greater than 101 and less than 199 (e.g. 150).
    - For the module id field, use the field @@TLS@MOD@ID in
      class C_WSA64.
    - For offset for the TLS variable from the beginning of the
      TLS template, use the calculation -- offset of the field
      for the TLS variable in class C_WSA64 minus the offset of
      the field @@TLS@BEGIN in class C_WSA64.
    - During binder AUTOCALL processing member CELQTLSI in
      data set SCEEBND2 will get included to resolve the
      references to @@TLS@MOD@ID and @@TLS@BEGIN.
    
    The old method:
    - A TLS variable cannot be initialized to the address of
      a writable static variable using this method.
    - Define fields for TLS variables in the class C_TLS64.
    - For the module id field, use the field @@TLS@MODULEID
      in class C_WSA64.
    - For offset for the TLS variable from the beginning of the
      TLS template, use offset of the field for the TLS variable
      in class C_TLS64.
    - During binder AUTOCALL processing member CELQTLSO in
      data set SCEEBND2 will get included to resolve the
      references to @@TLS@MODULEID.
    
    
    z/OS Language Environment Runtime Messages (SA38-0686)
    Add two new abend reason codes to abend U4093 (X'FFD')
    
    X'23C' (572)
    The program object contains both class C_TLSINFO and class
    C_TLSINFO2. For programs that use thread local storage (TLS),
    each of these two classes is used for a different method of
    allocating the TLS template. Language Environment only supports
    using a single method in a program object.
    
    Most likely, the program object was created from more than one
    source part. Some parts were compiled using the older method
    and others were compiled using the newer method. To correct
    this problem, make sure that all parts that use thread local
    storage have been compiled using the same method. To see what
    method is used by the Open XL C/C++ compiler, please refer to
    IBM Open XL C/C++ for z/OS documentation.
    
    X'240' (576)
    Size of class C_TLSINFO is not 8 or size of class C_TLSINFO2
    is not 24.
    

APAR Information

  • APAR number

    PH62468

  • Reported component name

    LE C LIB FOR Z/

  • Reported component ID

    568819805

  • Reported release

    7E0

  • Status

    CLOSED UR1

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    YesSpecatt / New Function / Xsystem

  • Submitted date

    2024-07-25

  • Closed date

    2025-09-11

  • Last modified date

    2025-10-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UO04849 UO04851

Modules/Macros

  • CEEPPOS  CELHZDMD CELHZNMD CELQDIR7 CELQDIR9 CELQINC  CELQPOS
    CELQTLSI CELQTLSO CELQZDMD CELQZNMD EDC4022B EDC403B1
    

Publications Referenced
SA380688XXSA380686XX   

Fix information

  • Fixed component name

    LE C LIB FOR Z/

  • Fixed component ID

    568819805

Applicable component levels

  • R7E0 PSY UO04851

       UP25/09/24 P F509  

  • R7F0 PSY UO04849

       UP25/09/24 P F509  

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSTLTF","label":"z\/OS XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7E0","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
02 October 2025