We have the Micro Focus Visual COBOL(v6.0.0.138) application setup on Linux (RHEL 8) and the database is MS-SQL.
The Cobol application communicates to an External application using a 'C' socket program. A Cobol module calls the ‘C’ socket program passing the required information (Server name, Port number) using a pointer. At the point of calling the ‘C’ program, the application fails with the message as below,
Execution error : file 'system/bin/CallSocket.gnt'
error code: 114, pc=0, call=1, seg=0
114 Attempt to access item beyond bounds of memory (Signal 11)
Please find below the program logic which invokes the C program,
MOVE 1 TO WS-UNSTR-PTR.
MOVE ZERO TO WS-UNSTR-CTR.
MOVE ZERO TO WS-UNSTR-FLD-CTR
MOVE SPACES TO WSOK-HST-NM.
UNSTRING WS-SRV-NM
DELIMITED BY SPACES
INTO WSOK-HST-NM
COUNT IN WS-UNSTR-CTR
WITH POINTER WS-UNSTR-PTR
TALLYING IN WS-UNSTR-FLD-CTR
ON OVERFLOW CONTINUE
END-UNSTRING.
MOVE WS-UNSTR-CTR TO WSOK-HST-NM-LEN
MOVE WSOK-HST-NM-LEN TO LCPRG-LOOKUP-NM-LEN.
CALL WSOK-ADDR-SET-PGM USING WSOK-HST-NM
LCPRG-LOOKUP-NM-ADDR-PTR.
*Start of WSOK-ADDR-SET-PGM
SET ADDR-ADDRESS-POINTER TO ADDRESS OF ADDR-DATA-ITEM.
*End of WSOK-ADDR-SET-PGM
MOVE LENGTH OF LCPRG-COMMAREA-INFO TO LCPRG-COMMAREA-LEN.
CALL 'CPRG' USING BY REFERENCE
LCPRG-COMMAREA-INFO.
Please find the error reported in the MFTrace log,
05:27:39.812 MF.RTS 50 0 3 0 "CallSocket"
05:27:39.814 MF.RTS 23 1 0 0 "Cprg.so" 00007F796C5D1230
05:27:39.814 MF.RTS 255 3 114 3 "<NULL>"
05:27:39.836 MF.RTS 140 1 2 "
Execution error : file '/system/bin/CallSocket.gnt'
error code: 114, pc=0, call=1, seg=0
114 Attempt to access item beyond bounds of memory (Signal 11)"
Kindly provide your suggestions to resolve this issue.
#Linux
#c
#SQL
#C
#COBOL
#VisualCOBOL
#MicroFocusVisualCobol