Preventive Service Planning
Abstract
In certain situations a segmentation violation (signal 11) is driven in C/C++ programs. The traceback file shows the signal occurred from fprintf function.
Content
The CICS CONSOLE shows:
CICS Signal Handler entered with signal: 11SERVICE_MESSAGE 12/21/07 12:49:17.674093649 XXXX 98454/0001 : Traceback file '/var/cics_regions/XXXX/dumps/dir1/cicsas98454.traceback' for transaction 'XX01' is generated
CICS Signal Handler entered with signal: 11
CSMT.out shows:
ERZ015028W/0154 12/21/07 12:49:17.674270305 XXXX 98454/0001 : Exception in user application code (XX02) - exception string is: 'exc_e_illaddr'
ERZ015018W/0010 12/21/07 12:49:17.674735731 XXXX 98454/0001 : Abnormal Termination 'ASRA', Transaction 'XX01', Program ''
TRACEBACK file shows:
>>>>>>>>>>>>>>>>>>>>>>> TraceBack Header <<<<<<<<<<<<<<<<<<<<<<<<<
TIMESTAMP : 12/21/07 12:49:17.673335379
REGION : XXXX
TRANID : XX01
PROGRAM : XX01
SRVID : 105
PID : 98454
TID : 1
SIGNAL : 11
>>>>>>>>>>>>>>>>>>>>>>> Function Stack <<<<<<<<<<<<<<<<<<<<<<<<<
17 - Function _doprnt Offset = 01F4
16 - Function fprintf Offset = 0168
15 - Function ExecUpdate Offset = 011C
14 - Function DataAdapter_UpdateRow Offset = 023C
13 - Function DataAdapter_UpdateEntity Offset = 0190
12 - Function DataAdapter_UpdateEntitySet Offset = 0100
11 - Function main Offset = 0CD0
10 - Function PinCA_StartC Offset = 04E0
9 - Function TasPR_CallApplication Offset = 0C8C
8 - Function TasPR_RunProgram Offset = 0B68
7 - Function TasPR_IRun Offset = 09C0
6 - Function TasPR_Run Offset = 08E8
5 - Function PinCA_Route Offset = 06C4
4 - Function ComFS_APPCServ Offset = 0FA4
3 - Function TasTA_Exec Offset = 0C18
2 - Function TasTA_Run Offset = 0D88
1 - Function main Offset = 1190
0 - Function __start Offset = 0098
The application program code sample as seen below will generate the error sometimes:
long funa(const char *pSql)
{
EXEC SQL BEGIN DECLARE SECTION;
char dyn_statement[10240] = "\0";
EXEC SQL END DECLARE SECTION;
strcpy(dyn_statement , pSql) ;
fprintf(stderr , "%s\n" , pSql) ;//sometimes signal 11 raised from here
}
This code sample shows the fprintf function does not use the dyn_statement variable. Sometimes the signal 11 segmentation violation will be raised with its use. The segmentation violation can be corrected by adding this line of code:
"memset(dyn_statement,0,sizeof(dyn_statement))"
to the source code before the line:
"strcpy(dyn_statement , pSql)".
Was this topic helpful?
Document Information
More support for:
TXSeries for Multiplatforms
Software version:
6.0, 6.1, 6.2, 7.1, 8.1, 8.2
Operating system(s):
AIX, HP-UX, Linux, Solaris
Document number:
358627
Modified date:
02 August 2018
UID
swg21318241