IBM Support

Diagnostics to collect for memory corruption

Troubleshooting


Problem

Diagnostics to collect for memory corruption

Symptom

DB2 instance crash with trap file showing the following functions at the top of the stack


sqloCrashOnCriticalMemoryValidationFailure                
SQLO_MEM_POOL::diagnoseMemoryCorruptionAndCrash
sqlofmblkEx

Resolving The Problem

1) Enable core/userdump file

Linux/Unix: Enable coredumps as per FAQ - Enabling coredumps for DB2 diagnostics for DB2 support.

Windows: Configure userdump by following "Configuring Windows Vista/7/10/2008" from Configuring Windows to produce a user-mode dump d

2) This is an optional step.

======== WARNING ===========

Setting DB2MEMDBG=PROTECT may negatively impact performance!! Do not implement on production system without first testing or unless advised by DB2 Defect Support. This will result in slower memory allocation and larger memory allocation because additional guard pages are allocated for each allocation. However this may provide temporary relief from DB2 instance crashes.

======== WARNING ===========

In the db2dump/FODC* directory there will be a file ending in mem_diagnostics. Open this file and check the top to determine which memory segment reported the error.

In example below it is 12 so this is specified in db2memdbg variable.


      Pool dump time: 2017-01-01-12:55:08.25
             Pool ID: 20 (Applications Shared Heap - appshrh)
             Address: 0x000000C080020490
            Set type: 12 (APL_CTL)

To Enable:


db2stop
db2set db2memdbg=PROTECT,12
db2start

To Disable:


db2stop
db2set db2memdbg=
db2start

During next crash additional memory diagnostics will be output to DB2DUMP directory:


memdbg.log
memdbg.use
p<pid>t<tid>.mem

Next time DB2 crashes collect diagnostics created by #1 and #2 (optional).

Note:

Due to large memory page sizes, DB2MEMDBG=PROTECT option is not available on PPCLE.
Instead,  DB2MEMDBG=PROTECT_LIGHT can be used (available starting DB2 11.5). PROTECT_LIGHT mode is adding guard pages only for contiguous memory blocks in DB2 memory pools, significantly reducing memory overhead. Downside of this mode is lower granularity of memory protection, because not every allocated memory block is backed by guard page.

DB2MEMDBG=PROTECT_LIGHT is not limited to PPCLE architecture and can be used in all supported environments.

[{"Type":"SW","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PlCAAU","label":"Corruption->Memory Corruption"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.1.0;10.5.0;11.1.0;11.5.0"}]

Document Information

Modified date:
10 May 2021

UID

swg22009637