Troubleshooting
Problem
Continuous 000003 (CTL-3) system errors occur when the ZTRAP MA or ZTRAP EA command is processed when the following conditions exist:
- APAR PJ45799, which provides the capability to selectively skip C function trace, is applied.
- Shared object CISO was compiled with GCC 7 and the -mtpf-trace-skip compile option. APAR PJ45799 updated the base/rt/ciso.mak file to use this compile option.
- The following system traces that are managed by the ZSTRC command are not active:
- Function trace (FUNCTR)
- ECB trace with extended functions (FUNCEXT)
- ECB stack validation mode (STACKVAL)
- z/TPF automated test cases (TESTAUTO)
Cause
APAR PJ45799 changed the C function entry hook that is generated when a shared object is compiled with GCC 7 and the -mtpf-trace-skip compile option. With these changes, the C function entry hook calls a hook handler routine that determines whether to skip C function trace. When this hook is processed, there are two different hook locations that must be enabled. Specifically, when the CP_HOOK_CENTER hook is enabled, the CP_HOOK_CENTER2 must also be enabled.
When the ZTRAP MA or ZTRAP EA command is processed, the CP_HOOK_CENTER hook is enabled; however, changes were not made to enable the CP_HOOK_CENTER2 hook. If another capability, for example C function trace (FUNCTR), is already active, both hooks are enabled. If other processes that use these hooks are not active, then both the CP_HOOK_CENTER and CP_HOOK_CENTER2 hooks are disabled. However, when the ZTRAP MA or ZTRAP EA command is processed, only the CP_HOOK_CENTER hook is enabled. If the CISO shared object that is being used was compiled with GCC 7 and the -mtpf-trace-skip compile option, every time that a C function is called in the CISO shared object, a 000003 (CTL-3) system occurs because the CP_HOOK_CENTER2 hook is not enabled.
Note: When APAR PJ45799 is applied, the CISO and CPP1 shared objects are both recompiled with the -mtpf-trace-skip compile option by default. This failure can occur even when the FUNCSKIP parameter on the ZSTRC command is disabled.
Resolving The Problem
APAR PJ46263 resolves this problem. If APAR PJ46263 cannot be fully installed, you can apply a subset of the APAR to correct the problem.
Make the following updates to the base/rt/trap_init.c file:
- In the activate_hooks() function, add the following instruction:
tpf_activate_hook(CP_HOOK_CENTER2, tpf_trap); - In the deactivate_hooks() function, add the following instruction:
tpf_deactivate_hook(CP_HOOK_CENTER2, tpf_trap);
After you update the file, use the following commands to build the CTRP shared object:
maketpf -f CTRP trap_init.o
maketpf CTRP link
maketpf CTRP link
The following code shows where the changes must be made in the activate_hooks() and deactivate_hook() functions in the base/rt/trap_init.c file.
/*********************************************************************/
/* Function Name : activate_hooks */
/* */
/* Description : Activates hooks according to a package selected */
/* */
/* Input parameters : parms - pointer to a control area */
/* */
/* Output parameters : none */
/* */
/* Data levels: none */
/* */
/* Return values: none */
/* */
/* Normal: void */
/* Error: */
/* */
/*********************************************************************/
void activate_hooks(struct itrap *parms, int idx) //PJ35019
{
/* Function Name : activate_hooks */
/* */
/* Description : Activates hooks according to a package selected */
/* */
/* Input parameters : parms - pointer to a control area */
/* */
/* Output parameters : none */
/* */
/* Data levels: none */
/* */
/* Return values: none */
/* */
/* Normal: void */
/* Error: */
/* */
/*********************************************************************/
void activate_hooks(struct itrap *parms, int idx) //PJ35019
{
unsigned char pkgmsk = parms->pkgmsk, //PJ35019
msk = 1; //PJ35019
msk = 1; //PJ35019
//Go to main I-stream //PJ37121
if(ecbptr()->ce1isn != 1) //PJ37121
{ //PJ37121
struct swisc_immediate_input swisc_input; //PJ37121
swisc_input.istream=SWISC_IS_MAIN; //PJ37121
swisc_immediate(&swisc_input); //PJ37121
} //PJ37121
if(ecbptr()->ce1isn != 1) //PJ37121
{ //PJ37121
struct swisc_immediate_input swisc_input; //PJ37121
swisc_input.istream=SWISC_IS_MAIN; //PJ37121
swisc_immediate(&swisc_input); //PJ37121
} //PJ37121
//Pause all I-streams before activating hooks //PJ36703
pausc(PAUSC_BEGIN); //PJ36703
pausc(PAUSC_BEGIN); //PJ36703
//create mask for new package and add it to current mask
msk <<= idx; //PJ35019
pkgmsk |= msk; //PJ35019
msk <<= idx; //PJ35019
pkgmsk |= msk; //PJ35019
/* These hooks are needed by all options */
tpf_activate_hook(CP_HOOK_MAIN_EXT_TIMER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_MAIN_EXT_TIMER, tpf_trap); //PJ35019
if( (pkgmsk & (EIFLG+MAFLG+PRFLG+RCFLG) ) != 0 ){ //PJ35019
tpf_activate_hook(CP_HOOK_APPL_EXT_TIMER, tpf_trap); //PJ35019
} //PJ35019
if( (pkgmsk & (EAFLG+RCFLG) ) != 0 ){ //PJ35019
tpf_activate_hook(CP_HOOK_ECB_EXIT, tpf_trap);
} //PJ35019
if( (pkgmsk & (EAFLG+MAFLG) ) != 0 ){ //PJ35019
tpf_activate_hook(CP_HOOK_ECB_EXIT, tpf_trap);
} //PJ35019
if( (pkgmsk & (EAFLG+MAFLG) ) != 0 ){ //PJ35019
tpf_activate_hook(CP_HOOK_SVC, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_BACK, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_CENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_CENTER2, tpf_trap); //PJ46263
tpf_activate_hook(PAT_STUB_CSO_BSO_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_TPFDF_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_TPFDF_BACK, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_BACK, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_CENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_CENTER2, tpf_trap); //PJ46263
tpf_activate_hook(PAT_STUB_CSO_BSO_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_TPFDF_ENTER, tpf_trap); //PJ35019
tpf_activate_hook(CP_HOOK_TPFDF_BACK, tpf_trap); //PJ35019
} //PJ35019
//Free all I-streams //PJ36703
pausc(PAUSC_END); //PJ36703
pausc(PAUSC_END); //PJ36703
return;
}
}
/*********************************************************************/
/* Function Name : deactivate_hooks */
/* */
/* Description : Deactivates hooks according to a package selected */
/* */
/* Input parameters : parms - pointer to a control area */
/* */
/* Output parameters : none */
/* */
/* Data levels: none */
/* */
/* Return values: none */
/* */
/* Normal: void */
/* Error: */
/* */
/*********************************************************************/
void deactivate_hooks(struct itrap *parms, int idx) //PJ35019
{
unsigned char pkgmsk = parms->pkgmsk, //PJ35019
msk = 1; //PJ35019
//Go to main I-stream //PJ37121
if(ecbptr()->ce1isn != 1) //PJ37121
{ //PJ37121
struct swisc_immediate_input swisc_input; //PJ37121
swisc_input.istream=SWISC_IS_MAIN; //PJ37121
swisc_immediate(&swisc_input); //PJ37121
} //PJ37121
if(ecbptr()->ce1isn != 1) //PJ37121
{ //PJ37121
struct swisc_immediate_input swisc_input; //PJ37121
swisc_input.istream=SWISC_IS_MAIN; //PJ37121
swisc_immediate(&swisc_input); //PJ37121
} //PJ37121
//Pause all I-streams before deactivating hooks //PJ36703
pausc(PAUSC_BEGIN); //PJ36703
pausc(PAUSC_BEGIN); //PJ36703
//create mask for package and remove it from current mask
msk <<= idx; //PJ35019
pkgmsk &= 0xFF-msk; //PJ35019
msk <<= idx; //PJ35019
pkgmsk &= 0xFF-msk; //PJ35019
if(pkgmsk == 0){ //PJ35019
/* These hooks are needed by all options */
tpf_deactivate_hook(CP_HOOK_MAIN_EXT_TIMER, tpf_trap);
} //PJ35019
/* These hooks are needed by all options */
tpf_deactivate_hook(CP_HOOK_MAIN_EXT_TIMER, tpf_trap);
} //PJ35019
if( (pkgmsk & (EIFLG+MAFLG+PRFLG+RCFLG) ) == 0 ){ //PJ35019
tpf_deactivate_hook(CP_HOOK_APPL_EXT_TIMER, tpf_trap);
} //PJ35019
tpf_deactivate_hook(CP_HOOK_APPL_EXT_TIMER, tpf_trap);
} //PJ35019
// Only deactivate the exit hook for RC, EA will turn it off later,
// because we might still be tracing an ECB.
if( (pkgmsk & (EAFLG+RCFLG) ) == 0 ){ //PJ35019
//Check to make sure we are not deactivating EA
if(idx != EAINDX){ //PJ35019
tpf_deactivate_hook(CP_HOOK_ECB_EXIT, tpf_trap); //PJ35019
} //PJ35019
} //PJ35019
if( (pkgmsk & (EAFLG+MAFLG) ) == 0 ){ //PJ35019
tpf_deactivate_hook(CP_HOOK_SVC, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_BACK, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_CENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_CENTER2, tpf_trap); //PJ46263
tpf_deactivate_hook(PAT_STUB_CSO_BSO_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_TPFDF_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_TPFDF_BACK, tpf_trap); //PJ35019
} //PJ35019
tpf_deactivate_hook(CP_HOOK_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_BACK, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_CENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_CENTER2, tpf_trap); //PJ46263
tpf_deactivate_hook(PAT_STUB_CSO_BSO_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_TPFDF_ENTER, tpf_trap); //PJ35019
tpf_deactivate_hook(CP_HOOK_TPFDF_BACK, tpf_trap); //PJ35019
} //PJ35019
//Free all I-streams //PJ36703
pausc(PAUSC_END); //PJ36703
pausc(PAUSC_END); //PJ36703
return; /* we are done */
}
}
[{"Product":{"code":"SSZL53","label":"z\/Transaction Processing Facility (TPF)"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Service Bulletins","Platform":[{"code":"PF036","label":"z\/TPF"}],"Version":"1.1","Edition":"All Editions","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]
Was this topic helpful?
Document Information
Modified date:
09 November 2020
UID
ibm16360855