Fixes are available
January 2011 RTE for XL C/C++ for Linux, V10.1
June 2011 Update for XL C/C++ for Linux, V10.1
January 2012 RTE for XL C/C++ for Linux, V10.1
XL C/C++ for Linux Fix Pack 8 (January 2014 Update) for 10.1
January 2011 Update for XL C/C++ for Linux, V10.1
January 2012 Update for XL C/C++ for Linux, V10.1
July 2012 Update for XL C/C++ for Linux, V10.1
July 2012 RTE for XL C/C++ for Linux, V10.1
XL C/C++ Runtime for Linux Fix Pack 8 (January 2014 Update) for 10.1
June 2011 RTE for XL C/C++ for Linux, V10.1
APAR status
Closed as program error.
Error description
The following reduced test case segfaults if compiled with xlC on AIX, but runs correctly if compiled with g++ on AIX. $cat vec_throw_test.cpp #include <vector> #include <iostream> #include <stdexcept> using namespace std; static int n; class A { public: A() { me = n++; cout << "A() me=" << me << endl; } A(const A & x) { me = n++; cout << "A(A) me=" << me << ", x=" << x.me << endl; if ( me==13 ) throw runtime_error("constructor failure"); } const A & operator=(const A & x) { cout << "A=A me=" << me << ", x=" << x.me << endl; return *this; } ~A() { cout << "~A me=" << me << endl; } int me; }; int main() { try { vector<A> a_vec; a_vec.reserve(10); A a; for (size_t i=0; i<15; ++i) { cout << "create " << i << endl; a_vec.push_back(a); cout << "vec=["; for (size_t j=0; j<a_vec.size(); ++j) cout << " " << a_vec[j].me; cout << " ]" << endl; } } catch ( const exception & x ) { cout << "caught exception: " << x.what() << endl; } return 0; } $xlC vec_throw_test.cpp $./a.out .... .... Memory Fault
Local fix
N/A
Problem summary
PROBLEM DESCRIPTION: When a throw occurs in a user copy ctor when insertion causes a vector to relocate and grow, an unitialized pointer is used when cleaning up the partially constructed vector. USERS AFFECTED: std::vector on aix.
Problem conclusion
The vector pointer is now initialized. Apply recommended service.
Temporary fix
Comments
APAR Information
APAR number
LI75854
Reported component name
XL C/C++ RHEL52
Reported component ID
5724U8310
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-01-27
Closed date
2011-01-27
Last modified date
2011-01-27
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ RHEL52
Fixed component ID
5724U8310
Applicable component levels
RA10 PSN IZ81882
UP06/09/13
Document Information
Modified date:
15 October 2021