C calling COBOL periodically a call to acu_initv() hangs

0 Likes

Problem:

A user is trying to create a custom daemon process that invokes a COBOL program from a C program.  The C process listens on a port for incoming socket communication.  When a new request is received, the C process invokes the Solaris fork() system function to spawn a child process.

That child process parses the information read from the socket and calls another C function.  Within that C function calls to acu_initv() and acu_cobol() functions are made to run a COBOL program.  When the COBOL program returns, the child process sends a response back to the client and the child process ends.  

These steps work fine for a period of time.  Eventually, however, one of these child processes will hang.  It appears to get stuck in acu_initv().

Resolution:

There was an infinite loop in the socket layer code between the runtime libraries and AcuShare that causes this behavior.

ECN-3836 which is included in version 9.0.0 contains a fix for an infinite loop in the socket layer (see text of the ECN below).

---------------------------------------------------------------------------------------------------------------------

SUBJECT: Fix two possible infinite loops in the socket layer

Change Number:  ECN-3836

Status:         Complete

Type of Change: Correction

Priority:       Low

Incidents:      2199774

RPI Number:

1063321

Date:        2008-08-28

Product:     ACUCOBOL-GT

Module:      socks

New Version: 9.0.0

Machines Affected: all

Known Versions Affected: all

DESCRIPTION of problem or enhancement:

This change corrects two instances in the socket layer code where an

infinite loop is possible were a socket to close or time out during

handshaking.

INSTRUCTIONS for use:

None.

---------------------------------------------------------------------------------------------------------------------

The behavior described in the ECN has not reproduced without using C programs to call COBOL.  Standard communication between the ACUCOBOL-GT runtime and AcuShare is not impacted by the loops that were corrected.

Old KB# 3184
Comment List
Anonymous
Related Discussions
Recommended