IBM Support

IC74031: REUSING OF DB2HISTORYDATA STRUCTURE FOR REPEATED DB2HISTORYGETENTRY API CALLS MIGHT PRODUCE UNEXPECTED RESULTS

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • db2HistoryGetEntry has a field pioHistData which takes in a
    struct of db2HistoryData type.  If an application reuses the
    same db2HistoryData type for consecutive calls to
    db2HistoryGetEntry, then the API might produce wrong results, or
    even trap.
    
    The problem has to do with a field inside the db2HistoryData
    called poEventSQLCA.  If this field is unset, then internally
    the db2HistoryGetEntry API will set it up with a dummy for the
    API to process.  At the end of the API it will free the memory
    of the dummy but not nullify the pointer on the structure.  This
    causes problem to subsequent calls to db2HistoryGetEntry with
    the same instance of db2HistoryData struct as the pointer is
    non-NULL and the API tries to dereference it.
    
    This problem only happens when using a v97 client to talk to a
    server in v97 or above.
    

Local fix

  • The fix is to memset the db2HistoryData struct every time before
    calling db2HistoryGetEntry.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * user of db2HistoryGetEntry API                               *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See error description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * memset the db2HistoryData struct before passing it to        *
    * db2HistoryGetEntry.                                          *
    ****************************************************************
    

Problem conclusion

  • Fix in v97 fp 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC74031

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-01-21

  • Closed date

    2011-04-28

  • Last modified date

    2011-04-28

  • 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

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

  • R970 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC74031

Modified date: 28 April 2011