IBM Support

PI74422: GENERATED STRUCT FROM DSECT UTILITY DOES NOT MATCH ORIGINAL ASM DSECT

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • After processing by the DSECT utility, a generated C struct does
    not match the memory layout of the original ASM input.
    
    The DSECT utility appears to be adding a large number of
    filler/padding bytes.
    
    
    === TEST CASE ===
    
    ZWSA     DSECT ,
    T1MAX    EQU   1345
    T1DIM    DC    A(T1MAX)
    TABLE1   DS    0D
    T1TOP    DC    (T1MAX)XL(L_T1ELEM)'00'
    T1BOT    DC    X'FFFFFFFFFFFFFFFF'
    LZWSA    EQU   *-ZWSA
    T1ELEM   DSECT ,
    T1_NOM   DS    XL8
    T1_EP    DS    F
    T1_CPT   DS    F
    T1_UTI   DS    F
    T1_TYP   DS    F
    T1_SIZ   DS    F
    T1_FEP   DS    F
    L_T1ELEM EQU   *-T1ELEM
             END
    
    
    The memory size/layout from the ASM output shows:
    ================================================================
    D-Loc    Object Code Addr1 Addr2    Stmt     Source Statement
    00000000           00000000 0000A830 1 ZWSA   DSECT ,
                        00000541          2 T1MAX EQU 1345
    00000000 00000541                    3 T1DIM  DCA(T1MAX)
    00000008                             4 TABLE1 DS 0D
    00000008 0000000000000000            5 T1TOP  DC (T1MAX)XL(L_T1E
    0000A828 FFFFFFFFFFFFFFFF            6 T1BOT  DC X'FFFFFFFFFFFFF
    
      *** SIZE OF 'ZWSA':   A828 + 8 = 0xA830
    
                                          Dsect Cross Reference
    Dsect     Length      Id       Defn
    T1ELEM   00000020  FFFFFFFE       8
    ZWSA     0000A830  FFFFFFFF       1 <<=== SIZE OF 'ZWSA' DSECT
                                                 TO BE 0xA830//43056
    ================================================================
    
    The generated C struct shows:
    ================================================================
    #pragma pack(packed)
    
    struct zwsa {
      void * __ptr32 t1dim;
      unsigned char  _filler1[4];   // ***
      struct {
        unsigned char  _t1top[1345][32];
        unsigned char  _filler2[22504];   // ***
        } table1;
      unsigned char  _filler3;   // ***
      unsigned char  t1bot[8];
      };
    
    #define t1top    table1._t1top
    
    /* Values for field "t1bot" */
    #define lzwsa 0xA830
    
    struct t1elem {
      unsigned char  t1_nom[8];
      int            t1_ep;
      int            t1_cpt;
      int            t1_uti;
      int            t1_typ;
      int            t1_siz;
      int            t1_fep;
      };
    
    /* Values for field "t1_fep" */
    #define l_t1elem 0x20
    
    #pragma pack(reset)
    ================================================================
    
    The _filler# padding bytes noted by '***' are bloating the
    'zwsa'  struct to 65561 bytes, which does not match the original
    DSECT.
    

Local fix

  • None.  Manually correct generated C struct.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: USERS OF XLC ON ZOS.                         *
    ****************************************************************
    * PROBLEM DESCRIPTION: WHEN THE LENGTH OF DS IS GREATER THEN   *
    *                      32767 DSECT UTILITY GENERATES INVALID   *
    *                      FILLER WHICH RESULTS WITH 'C' STRUCT    *
    *                      BEING TO LARGE AND HAVING INVALID++     *
    *                      OFFSET FOR THE MEMBERS FOLLOWING THE    *
    *                      FILLER.                                 *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    .
    

Problem conclusion

  • APPLY SERVICE PROVIDED.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI74422

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    790

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-01-05

  • Closed date

    2017-02-10

  • Last modified date

    2017-04-04

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

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

    PI74434 PI74611 UI44574 PI77833

Modules/Macros

  •    CCNECICS CCNECWI  CCNEDSCT CCNEDWRT CCNED210
    CCNEFILT CCNEHIFC CCNEMDEP CCNEOPTP CCNEP    CCNEPP   CCNETBY
    CCNMSGE  CCNMSGT
    

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R790 PSY UI44574

       UP17/03/09 P F703

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":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"790","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSQKCWV","label":"IBM C\/C++ for MVS\/ESA"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"790","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
09 August 2024