Fixes are available
XL C/C++ for AIX Fix Pack 21 (October 2015 PTF) for 10.1
XL C++ Runtime for AIX Fix Pack 5 (October 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
APAR status
Closed as program error.
Error description
Continuation from APAR IV73852. The fix for APAR IV73852 is contained within the <fstream> header file. The XL C++ Runtime must be re-built with this fixed header file to correct any instances of the issue due to <fstream> usage within the XL C++ Runtime itself.
Local fix
Problem summary
PROBLEM DESCRIPTION: The ofstream object incorrectly keeps the file descriptor alive after fclose() failed and the is_open flag remains true. This allows the second fclose() to close the file but the file descriptor has been freed by the first fclose() and reused by the system for another file. As a result, the second fclose() closes a different stream. USERS AFFECTED: Users who close a file stream twice because the first attempt failed with an error such as no space left on device.
Problem conclusion
The ofstream object behavior does not comply with the C++ standard and has now been fixed. This APAR (IV78285) denotes a re-build of the XL C++ Runtime to use the fixed <fstream> header file, to ensure all usage of ofstream within the XL C++ Runtime itself is corrected. APAR IV73852 denotes the fix to the <fstream> header file, which corrects the problem in applications that use ofstream directly in their code.
Temporary fix
Comments
APAR Information
APAR number
IV78285
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2015-10-23
Closed date
2015-12-30
Last modified date
2015-12-30
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++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
RC10 PSY
UP
Document Information
Modified date:
01 October 2021