IBM Support

LI74903: BUSS ERROR WITH VA ARGS

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The following test case leads to a bus error at runtime:
    
    ===== COMPILE COMMAND:
    /bgsys/drivers/ppcfloor/comm/bin/mpixlcxx_r -o bustest test.cpp
    
    ===== TESTCASE:
    =========Start of test.cpp===============
    #define MPICH_IGNORE_CXX_SEEK 1
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdarg.h>
    #ifdef USEMPI
    #include <mpi.h>
    #endif
    
    // constants and enumerated types
    
    const int  Output_Text_File = 1 << 0 ;
    const int  Output_Screen    = 1 << 1 ;
    const int  Output_Error     = 1 << 2 ;
    
    // Class Prototypes
    
    class autumn_class
    {
      public:
    
        int Print(int output_files,
                  const char *format, ...);
    
    };
    
    // Global Vars
    
    autumn_class autumn;
    void gyllen_test(void);
    
    // Classes
    
    int autumn_class::Print(int output_files,
                           const char *format, ...)
    {
        int num_chars;
        va_list args;
    
        va_start( args, format );
    
    // Eureka! This Line Generates Bus Error
    // Comment this line, and un-comment the next call to
    // vfprintf to see code run without a bus error.
        num_chars = vfprintf( stdout, format, args );
    
    // This Line Does Not!
    // Only difference is storing the return from the call
    // to vfprintf into the num_chars local variable.
        // vfprintf( stdout, format, args );
    
        va_end( args );
    
        return 0;
    }
    
    // Small routine to loop over problem code many times
    
    void gyllen_test(void)
    {
        for (int i = 0; i < 500; i ++ )
        {
                autumn.Print(Output_Screen,
                            "\t%03d: X-Coordinate Offset to Move
    Surfaces :\t       %13.6e %s\n",
                            i,
                            99.9,
                            "abcdefghijklmnop");
        }
    }
    
    // Main routine
    // Open file pointer
    // Call gylle_test routine
    
    int main(int argc, char **argv)
    {
    #ifdef USEMPI
        if (MPI_Init(&argc, &argv) != 0) {
            fprintf(stderr,"MPI_Init failed\n");
            abort();
        }
    #endif
    
        gyllen_test();
    
    #ifdef USEMPI
        if (MPI_Finalize() != 0) {
            fprintf(stderr,"MPI_Init failed\n");
        }
    #endif
    }
    ==============End of test.cpp=============
    

Local fix

  • n/a
    

Problem summary

  • USER AFFECTED:
    This affects Blue Gene users who are using variable arguments.
    
    PROBLEM DESCRIPTION:
    There is a runtime failure with 'signal 7'.
    var args creates a buffer in the automatic area of the callee
    to store var args passed in registers.
    The register is only 4 byte aligned, not 8.
    As a result, when saving floating point values, an alignment
    error occurs and the program traps to the OS to fix up the load
    After the default value of 1000 of these misaligned stores, the
    OS throws a signal 7.
    

Problem conclusion

  • The compiler has been fixed so that the callee buffer is now
    8-byte aligned.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74903

  • Reported component name

    XL C/C++ AE BG/

  • Reported component ID

    5799HJE00

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-08-19

  • Closed date

    2010-01-12

  • Last modified date

    2010-01-12

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

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

    LI75703

Fix information

  • Fixed component name

    XL C/C++ AE BG/

  • Fixed component ID

    5799HJE00

Applicable component levels

  • R900 PSY

       UP



Document information

More support for: XL C/C++
Compiler

Software version: 9.0

Reference #: LI74903

Modified date: 12 January 2010


Translate this page: