IBM Support

LI76901: INLINE ASM MAY CAUSE SEGMENTATION FAULT

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When inline assembly (asm("")) is used in a compilation unit,
    the C++ compiler does not handle C++ exceptions correctly.
    
    The symptoms range  from exceptions not being thrown, to not
    being caught correctly, to segmentation faults.
    
    Consider the following testcase test.cc:
    
    ///////////// test.cc //////////////////
    
    #include <cstdio>
    #include <exception>
    using namespace std;
    
    void junk() {
      asm("nop");
    }
    
    int main(int argc, char** argv) try {
      throw std::exception();
    } catch (...) {
      puts("Caught Exception");
    }
    ///////////////////////////////////////
    
    Compile testcase:
    
    $xlC test.cc
    
    Execute the binary:
    
    $./a.out
    Segmentation fault
    

Local fix

  • N/A
    

Problem summary

  • parts of ehframe descriptor are missing or wrong in inline asm
    

Problem conclusion

  • recommended for C++ users who also use inline asm
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76901

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-07-16

  • Closed date

    2012-07-16

  • Last modified date

    2012-07-16

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

    LI76731

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

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels

  • RA10 PSY

       UP



Document information

More support for: XL C/C++

Software version: A.1

Reference #: LI76901

Modified date: 16 July 2012


Translate this page: