Just for CICS - Is your Storage being violated?
ByronBaldwin 06000099ST Visits (7200)
Whether your a novice or have been working with CICS for 40+ years, you will eventually encounter a storage violation in your CICS environment. A storage violation can be caused by a one byte overlay or a massive multiple page overlay that can lead to your region crashing. The massive overlays can lead to a number of different abends in CICS but the most common storage violation is identified by a DFHSM0102:
In the DFHSM0102 message, a X'code' (X'0D11', X'0F0C', X'030B') is provided that corresponds to a trace entry in the CICS trace table. This trace entry will provide some valuable information as to where this storage overlay is occurring (I will discuss this a bit later). CICS continues unless you specify in the dump table that CICS should terminate.
Receiving the DFHSM0102 dump indicates the Storage Accounting Area (SAA), also referred to as Storage Check Zones (SCZ), in CICS has been altered. The SAA is an X'8' byte delimiter that is added on each piece of transaction storage at the beginning and the end during the getmain request and it includes notations that indicate the type of storage (CICS/USER, ABOVE/BELOW the line storage) along with what task number owns this storage.
Usually the overlay is not detected until task termination during the freemaining of transaction storage.
Once you receive the storage violation dump you can attempt to identify who is possibly overlaying the storage. Initially you will need to obtain the X'code' given in the DFHSM0102 dump and locate this trace entry in the CICS trace with IPCS VERBX DFHPDnnn 'TR=2', where nnn is the version of CICS you are running. All 3 possible X'code' values will provide you with basically the same information, but there is some specific information provided with each, so you should locate the X'code' entry in the Storage manager domain trace points section of the CICS Trace Entries manual. The trace entry will provide you with an address as well as a certain number of bytes that include the leading and trailing Storage Check Zone areas (remember if you are receiving the DFHSM0102, some portion of the SCZ has been altered). With the address in hand you can verify the length of the piece of storage in question and what task it is associated with by doing a search in the SM domain (VERBX DFHPDnnn 'SM=3'). The address should be located in a Storage Element Descriptor (SCE). Below is an example of an SCE:
The 3rd word will be your address and the 4th word will be the length of the storage. Double check to ensure the task number in the SCE matches the task number running in trace at the time of dump.
Now with the address and length of the piece of storage in question, go take a look at the storage in BROWSE mode by entering an =1 on the command line (or go to option 1 from the IPCS PRIMARY OPTION MENU). This will display the following panel:
Verify that the ASID displayed matches the ASID of the CICS region for the dump. At the POINTER address, paste the address from the trace entry and press enter. Once here, verify the Storage Check Zones are intact, keeping in mind they are X'8' bytes in length at the beginning and end of the piece of storage in question. In our example SCE above, the SCZ should be M0099999. Once you identify which SCZ has been overlaid, if the overlay appears to be application data, please contact your application team to find out if they are able to identify what transaction or application owns the data. If you are unable to identify the storage at this point, you will need to activate the the Storage Violation Trap. This trap can be activated in two ways:
Ensure all trace components are set to standard level 1 except for EI and AP which should be set to 1-2. Your trace table should be at least 6M. Once the trap springs you will receive a DFHSM0103 dump:
DFHSM0103 applid A storage violation (code X'code') has been detected by the storage violation trap. Trap is now inactive.
The trap will be deactivated after the dump is issued.
To assist in debugging the DFHSM0103 dump, you can use the Debugging Storage Violations in CICS Support Technical Exchange Webcast.
Whether you are a novice or been working with the product for 40+ years, at some point you will have to rely on CICS support to assist in resolving certain issues. The MustGather - collect troubleshooting data document provides guidance on what documentation support will need. I would love to hear from you, so please feel free to leave a comment for this post.