Fixes are available
APAR status
Closed as program error.
Error description
When compiling with large file support, a bad cast within the C++ runtime is causing bad values from the fstream tellg() function. With large file support, 'long long' types are the main datatype for managing the large size of the file. When tellg() is called it relies on a macro called _FPOSOFF in <yvals.h> that does a cast to long, instead of long long. This bad cast cascades back to the 'pos_type'/''streampos' returned by tellg(), which gives an incorrect value. === TEST CASE === #include<iostream> #include<fstream> std::fstream fs("file", std::ios_base::in); // Where 'file' is a large file int main() { using namespace std; fs.seekg(0, std::ios_base::end); cout << "tellg() = " << fs.tellg() << endl; cout << "(uint32_t)tellg() = " << (uint32_t)fs.tellg() <<endl; }; OUPUT: $ xlC -qlonglong -D_LARGE_FILES apar.cpp $ ./a.out tellg() = -562486541 (uint32_t)tellg() = 3732480755 $ EXPECTED OUTPUT: $ xlC -qlonglong -D_LARGE_FILES apar.cpp $ ./a.out tellg() = 3732480755 (uint32_t)tellg() = 3732480755 $
Local fix
Cast return value of tellg() to uint32_t
Problem summary
PROBLEM DESCRIPTION: When compiling with large file support on AIX, a bad cast within the C++ runtime is causing bad values from the fstream tellg() function. USERS AFFECTED: User who use the file-based stream library (fstream) with large file support.
Problem conclusion
Please apply the fix if you are using large file support along with the file-based stream library.
Temporary fix
Comments
APAR Information
APAR number
IV95280
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2017-04-21
Closed date
2017-06-29
Last modified date
2017-06-29
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
IV97567 IJ08152
Fix information
Fixed component name
XL C/C++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"13.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]
Document Information
Modified date:
19 August 2024