IBM Support

IC89098: MEMORY OVERWRITE WHEN USING UTL_FILE or DBMS_OUTPUT.ENABLE with buffer size bigger then 32K.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Memory overwrite can happen if
    1) application is using DBMS_OUTPUT.ENABLE with buffer size
    bigger then 32K and data is written into the buffer which has no
    null terminators for longer then 32K bytes.
    
    2) application is using UTL_FILE.FCLOSE.
    
    The crash will have a message similar to the following in the
    db2diag.log:
     2012-08-30-00.17.48.856591-240 E3800797A1291      LEVEL: Severe
    PID     : 22216748             TID  : 30431       PROC : db2sysc
    0
    INSTANCE: dbinst1             NODE : 000         DB   : SAMPLE
    APPHDL  : 0-34250              APPID: *LOCAL.DB2.120830052553
    AUTHID  : DB2INST1
    EDUID   : 30431                EDUNAME: db2agent (SAMPLE) 0
    FUNCTION: DB2 UDB, SQO Memory Management,
    sqloDiagnoseFreeBlockFailure,
    probe:999
    MESSAGE : Memory validation failure, diagnostic file dumped.
    DATA #1 : String, 28 bytes
    Corrupt pool free tree node.
    DATA #2 : File name, 34 bytes
    22216748.30431.mem_diagnostics.txt
    
    CALLSTCK:
      [0] 0x09000000136BC624 pdLog + 0xD0
      [1] 0x0900000012A1B5E0
    diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc + 0x280
      [2] 0x0900000012A1B288
    diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc@glue7DC
    + 0x78
      [3] 0x090000001354F3E0
    .MemTreePut.fdpr.clone.499__13SQLO_MEM_POOLFP8SMemNodeUlP17SqloC
    hunkSubgroup + 0xC
      [4] 0x09000000135563E8 sqlofmblkEx + 0x278
      [5] 0x0900000015682AF4 sqlerTrustedRtnCallbackFmblk__FUiPPv
    +0x110
      [6] 0x090000001566F690 sqlerTrustedRtnCallbackRouter__FUiPPv
    +0xC4
      [7] 0x090000001B1952C8 freeMemory__FPv + 0x48
      [8] 0x090000001B195414 poolFree__FPv@AF16_10 + 0x14
      [9] 0x090000001B1965EC removeEntry__10hashBucketFPCvUl + 0x8C
    
    In the trap file produced, you will see the following:
     -------Frame------ ------Function + Offset------
    0x09000000132DED34 sqloCrashOnCriticalMemoryValidationFailure
    +0x30
    0x0900000012A1B5E8
    diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc + 0x288
    0x0900000012A1B288
    diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc@glue7DC
    + 0x78
    0x090000001354F3E0
    .MemTreePut.fdpr.clone.499__13SQLO_MEM_POOLFP8SMemNodeUlP17SqloC
    hunkSubgroup + 0xC
    0x09000000135563E8 sqlofmblkEx + 0x278
    0x0900000015682AF4 sqlerTrustedRtnCallbackFmblk__FUiPPv + 0x110
    0x090000001566F690 sqlerTrustedRtnCallbackRouter__FUiPPv + 0xC4
    0x090000001B1952C8 freeMemory__FPv + 0x48
    0x090000001B195414 poolFree__FPv@AF16_10 + 0x14
    0x090000001B1965EC removeEntry__10hashBucketFPCvUl + 0x8C
    0x090000001B196460 remove__9hashTableFPCvUl + 0x20
    0x090000001B1B1604 sqleml_removeFile__FP18sqleml_sessionDatai
    +0x44
    0x090000001B1B1538 sqleml_utl_file_fclose + 0x1B8
    0x09000000136AF41C sqloInvokeFnArgs + 0xD0
    0x0900000013F38964
    sqlriInvokerTrusted__FP10sqlri_ufobP21sqlriRoutineErrorIntf +0xC
    0x09000000136ACE1C sqlriInvokeInvoker__FP10sqlri_ufobb + 0xB78
    0x090000001372A474 sqlricall__FP8sqlrr_cb + 0x188
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Users of UTL_FILE or DBMS_OUTPUT.ENABLE                      *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Memory overwrite can happen if                               *
    * 1) application is using DBMS_OUTPUT.ENABLE with buffer size  *
    * bigger then 32K and data is written into the buffer which    *
    * has no                                                       *
    * null terminators for longer then 32K bytes.                  *
    *                                                              *
    * 2) application is using UTL_FILE.FCLOSE.                     *
    *                                                              *
    * The crash will have a message similar to the following in    *
    * the                                                          *
    * db2diag.log:                                                 *
    *  2012-08-30-00.17.48.856591-240 E3800797A1291      LEVEL:    *
    * Severe                                                       *
    * PID     : 22216748             TID  : 30431       PROC :     *
    * db2sysc                                                      *
    * 0                                                            *
    * INSTANCE: dbinst1             NODE : 000         DB   :      *
    * SAMPLE                                                       *
    * APPHDL  : 0-34250              APPID:                        *
    * *LOCAL.DB2.120830052553                                      *
    * AUTHID  : DB2INST1                                           *
    * EDUID   : 30431                EDUNAME: db2agent (SAMPLE) 0  *
    * FUNCTION: DB2 UDB, SQO Memory Management,                    *
    * sqloDiagnoseFreeBlockFailure,                                *
    * probe:999                                                    *
    * MESSAGE : Memory validation failure, diagnostic file dumped. *
    * DATA #1 : String, 28 bytes                                   *
    * Corrupt pool free tree node.                                 *
    * DATA #2 : File name, 34 bytes                                *
    * 22216748.30431.mem_diagnostics.txt                           *
    *                                                              *
    * CALLSTCK:                                                    *
    *   [0] 0x09000000136BC624 pdLog + 0xD0                        *
    *   [1] 0x0900000012A1B5E0                                     *
    * diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc +   *
    * 0x280                                                        *
    *   [2] 0x0900000012A1B288                                     *
    * diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc@glu *
    * e7DC                                                         *
    * + 0x78                                                       *
    *   [3] 0x090000001354F3E0                                     *
    * .MemTreePut.fdpr.clone.499__13SQLO_MEM_POOLFP8SMemNodeUlP17S *
    * qloC                                                         *
    * hunkSubgroup + 0xC                                           *
    *   [4] 0x09000000135563E8 sqlofmblkEx + 0x278                 *
    *   [5] 0x0900000015682AF4                                     *
    * sqlerTrustedRtnCallbackFmblk__FUiPPv                         *
    * +0x110                                                       *
    *   [6] 0x090000001566F690                                     *
    * sqlerTrustedRtnCallbackRouter__FUiPPv                        *
    * +0xC4                                                        *
    *   [7] 0x090000001B1952C8 freeMemory__FPv + 0x48              *
    *   [8] 0x090000001B195414 poolFree__FPv@AF16_10 + 0x14        *
    *   [9] 0x090000001B1965EC removeEntry__10hashBucketFPCvUl +   *
    * 0x8C                                                         *
    *                                                              *
    * In the trap file produced, you will see the following:       *
    *  -------Frame------ ------Function + Offset------            *
    * 0x09000000132DED34                                           *
    * sqloCrashOnCriticalMemoryValidationFailure                   *
    * +0x30                                                        *
    * 0x0900000012A1B5E8                                           *
    * diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc +   *
    * 0x288                                                        *
    * 0x0900000012A1B288                                           *
    * diagnoseMemoryCorruptionAndCrash__13SQLO_MEM_POOLFUlCPCc@glu *
    * e7DC                                                         *
    * + 0x78                                                       *
    * 0x090000001354F3E0                                           *
    * .MemTreePut.fdpr.clone.499__13SQLO_MEM_POOLFP8SMemNodeUlP17S *
    * qloC                                                         *
    * hunkSubgroup + 0xC                                           *
    * 0x09000000135563E8 sqlofmblkEx + 0x278                       *
    * 0x0900000015682AF4 sqlerTrustedRtnCallbackFmblk__FUiPPv +    *
    * 0x110                                                        *
    * 0x090000001566F690 sqlerTrustedRtnCallbackRouter__FUiPPv +   *
    * 0xC4                                                         *
    * 0x090000001B1952C8 freeMemory__FPv + 0x48                    *
    * 0x090000001B195414 poolFree__FPv@AF16_10 + 0x14              *
    * 0x090000001B1965EC removeEntry__10hashBucketFPCvUl + 0x8C    *
    * 0x090000001B196460 remove__9hashTableFPCvUl + 0x20           *
    * 0x090000001B1B1604                                           *
    * sqleml_removeFile__FP18sqleml_sessionDatai                   *
    * +0x44                                                        *
    * 0x090000001B1B1538 sqleml_utl_file_fclose + 0x1B8            *
    * 0x09000000136AF41C sqloInvokeFnArgs + 0xD0                   *
    * 0x0900000013F38964                                           *
    * sqlriInvokerTrusted__FP10sqlri_ufobP21sqlriRoutineErrorIntf  *
    * +0xC                                                         *
    * 0x09000000136ACE1C sqlriInvokeInvoker__FP10sqlri_ufobb +     *
    * 0xB78                                                        *
    * 0x090000001372A474 sqlricall__FP8sqlrr_cb + 0x188            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2  v9.7 FP8 or newer                            *
    ****************************************************************
    

Problem conclusion

  • Upgrade to DB2  v9.7 FP8 or newer
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC89098

  • 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

    2012-12-13

  • Closed date

    2013-04-08

  • Last modified date

    2013-04-08

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IC91743

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 #: IC89098

Modified date: 08 April 2013