Fixes are available
January 2011 PTF for XL C/C++ for AIX, V11.1
May 2011 PTF for XL C/C++ for AIX, V11.1
August 2011 PTF for XL C/C++ for AIX, V11.1
November 2011 PTF for XL C/C++ for AIX, V11.1
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.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
IZ91501
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-01-03
Closed date
2011-01-03
Last modified date
2011-01-05
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
Document Information
Modified date:
05 January 2011