IBM Support

IV78285: BAD FILE DESCRIPTOR DUE TO OFSTREAM NOT RELEASING FILE AFTER ENOSPC IN XL C++ RUNTIME

Subscribe

You can track all active APARs for this component.

 

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

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
01 October 2021