Skip to main content

.NET - Preprocessing under Visual Studio 2005

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Release 5.0.NET:

Just testing an own COBOL preprocessor mypreproc.gnt using this compiler directive PREPROCESS as usual, and got this:

Execution error : file 'c:\\path\\mypreproc.gnt'

error code: 114, pc=0, call=1, seg=0

114     Attempt to access item beyond bounds of memory (Signal 11)

Is there a hint available what to do to prevent this, because not involving any VS2005.NET environment mypreproc is running as well.

Resolution:

Yes, be aware of the following:

(1) It seems the mypreproc preprocessor is looping round the last line of source code. Under managed compiles, the compiler reads the source code in 2 phases and it's looping in phase1 until it runs out of memory.

However this is unlikely to be the final problem. A preprocessor for managed compiles needs to be reentrant. It does  n o t  mean about the REENTRANT directive, the pre-processor needs to be able to be called repeatedly in the same process.

On the initial preprocessor call from the checker (response code 0, with source file), the preprocessor should be in it's initial state, i.e. files closed. At the end of a compile it should free up all memory  to stop memory leaks. The checker may only parse part of a program so on reentry it needs to be able to free memory from a previous compile.

It should never execute a STOP RUN or this will close the Visual Studio 2005 IDE.

(2) Micro Focus would need to enhance the preprocessor interface quite a bit to allow it to work under background parse conditions in the VS2005 IDE. Meanwhile, to turn off background syntax checking. The option for this is under VS2005 IDE:

Tools->Options->Text Editor->COBOL->Miscellaneous->Enable background syntax checking , set to false.

Old KB# 4412