IBM Support

IV80372: SEGMENTATION FAULT IN BASIC_STRING CODE USING _NULLSTR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An application runtime segmentation fault occurs when using
    basic_string objects and the <xstring> _Nullstr() function.
    This function is used by the c_str() function when processing
    NULL strings.
    
    The segmentation fault occurs after the XL C++ Runtime level is
    updated to V13.1 .  Previous XL C++ Runtime releases do not
    encounter the issue.
    
    The segmentation fault is caused by an STH store instruction to
    an XL C++ Runtime symbol that is found in the read-only data
    section of the library.  Code may appear similar to:
    
    
    ------------------------------
    
        003088 lwz   80620120 1 L4A
                   gr3=.guard__C1___Nullstr__Q3_3std7_LFS_ON12bas
                   ic_stringXTwTQ2_3std11char_traitsXTw_TQ2_3std9
                   allocatorXTw__Fv(gr2,0)
    
        00308C lwz   80C20124 1 L4A
                   gr6=._C___Nullstr__Q3_3std7_LFS_ON12basic_stri
                   ngXTwTQ2_3std11char_traitsXTw_TQ2_3std9allocat
                   orXTw__Fv__1(gr2,0)
    
        003090 lwz   80030000 1 L4A
                   gr0=guard__C1___Nullstr__Q3_3std7_LFS_ON12basi
                   c_stringXTwTQ2_3std11char_traitsXTw_TQ2_3std9a
                   llocatorXTw__Fv(gr3,0)
    
        003094 cmpwi 2C000000 1 C4 cr0=gr0,0
    
        003098 bc    40820014 1 BF CL.254,cr0,0x4/eq,taken=50%(0,0)
    
        00309C addi  38800001 1 LI gr4=1
    
        0030A0 addi  38000000 1 LI gr0=0
    
        0030A4 stw   90830000 1 ST4A
                   guard__C1___Nullstr__Q3_3std7_LFS_ON12basic_st
                   ringXTwTQ2_3std11char_traitsXTw_TQ2_3std9alloc
                   atorXTw__Fv(gr3,0)=gr4
    
    **  0030A8 sth   B0060000 1 ST2Z
                   _C___Nullstr__Q3_3std7_LFS_ON12basic_stringXTw
                   TQ2_3std11char_traitsXTw_TQ2_3std9allocatorXTw
                   __Fv__1(gr6,0)=gr0
    
    ------------------------------
    
    
    Analysis of the memory location of the _C___Nullstr__Q3_3std
    7_LFS_ON12basic_stringXTwTQ2_3std11char_traitsXTw_TQ2_3std9a
    llocatorXTw__Fv__1 symbol symbol using the DBX debugger will
    show that it is found in the 0xD shared memory data section
    (read only section):
    
    
    ------------------------------
       (dbx) p
       &_C___Nullstr__Q3_3std7_LFS_ON12basic_stringXTwTQ2_3std11char
       _traitsXTw_TQ2_3std9allocatorXTw__Fv__1
       0xd3755bd4
       (dbx)
    ------------------------------
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION:
    C++ code containing string usage compiled with the V11.1.0.13
    compiler or earlier encounters runtime segmentation faults after
    upgrading to the XL C++ Runtime, V13.1 (fileset:  xlC.rte).  The
    XL C++ Runtime, V12.1 works correctly.
    
    The root issue of the problem is fixed in the XL C/C++ for AIX,
    V11.1.0.14 compiler PTF release, and corrects invalid _Nullstr()
    function code generation.  Code compiled with the V11.1.0.14
    release and later will not encounter the problem with the XL C++
    Runtime, V13.1 .
    
    For users with existing code compiled with V11.1.0.13 and
    earlier, this APAR will modify the XL C++ Runtime, V13.1 to
    accept the old code safely.
    
    USERS AFFECTED:
    Users with code compiled with the V11.1.0.13 release and
    earlier.
    

Problem conclusion

  • In the XL C++ Runtime, V13.1 release, the _Nullstr() runtime
    symbol
    '_C___Nullstr__Q3_3std7_LFS_ON12basic_stringXTwTQ2_3std11char_tr
    aitsXTw_TQ2_3std9allocatorXTw__Fv__1' was made read-only text,
    when it had been read/write data in the past.  This change
    caused the runtime segmentation fault when older pre-V11.1.0.14
    code would attempt to write to the symbol.  Code compiled with
    V11.1.0.14 and later does not write to this symbol.
    
    The symbol in the XL C++ Runtime, V13.1 has been made read/write
    data again to support older code.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV80372

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    D13

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-01-18

  • Closed date

    2016-03-14

  • Last modified date

    2016-03-14

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

    IV79436

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

Fix information

  • Fixed component name

    XL C/C++ RUNTIM

  • Fixed component ID

    5725C7201

Applicable component levels

  • RD13 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSC6KWG","label":"C\/C++ Runtime"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D13","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
14 March 2016