IBM Support

LI78989: DWARF DW_AT_TYPE : 0X0 WITH MULTI-DIMENSIONAL ARRAYS CAUSING DEBUGGER ERROR

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as fixed if next.

Error description

  • Incorrect DWARF debugging information is generated when
    multi-dimensional arrays are used, causing debugger errors when
    debugging the code.
    
    The specific code pattern causing the problem is the presence of
    a multi-dimensional array definition, followed immediately by
    another array of the same TYPE which is also the same SIZE as
    the second dimension of the multi-dimensional array.
    
    The compiler is incorrectly flagging some of the required debug
    type information of the multi-dimensional array as duplicate
    information.  The compiler then deleted the required type debug
    information; generating incorrect DWARF debugging information.
    This can cause errors when running the code with a debugger.
    
    
    An example of an error from the GDB debugger is:
    
       Dwarf Error: Cannot find DIE at 0x5ee6c2 referenced from DIE
       at 0x5f414c [in module test]
    
    This is caused by the incorrect DWARF debug information, as read
    by 'readelf -wi':
    
       <5abb>   DW_AT_type        : 0x0
    
    
    
       === TEST CASE ===
    
    char bad[5][10];
    struct a{
       char space[10];
    };
    int main(){
       struct a a1;
        return 0;
    }
    
    
    
    $ xlc -c t.c -g
    $ readelf -wi t.o | grep "DW_AT_type        : 0x0"
        <b1>   DW_AT_type        : 0x0
    $
    

Local fix

  • The issue can be worked around by modifying the code near the
    multi-dimensional array definition:
    
    - Change the array types so they do not match
    - Change the array sizes so they do not match
    - Move the multi-dimensional array definition AFTER the other
    array
    

Problem summary

  • The DWARF debug generation issue has been corrected, and
    'readelf -wi' output should no longer display "DW_AT_type
     : 0x0".  Debugging is no longer impaired.  The fix will be
    available in a future MOD release.
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    LI78989

  • Reported component name

    XL C/C++ LINUX

  • Reported component ID

    5725C7310

  • Reported release

    D13

  • Status

    CLOSED FIN

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-04-11

  • Closed date

    2016-04-11

  • Last modified date

    2016-04-11

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

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

Fix information

Applicable component levels

  • RD13 PSY

       UP



Document information

More support for: XL C/C++ for Linux

Software version: D13

Reference #: LI78989

Modified date: 11 April 2016