Created On:  11 February 2011

Problem:

A large COBOL program compiles and runs fine under Visual COBOL 2010 R3 on a 32-bit Windows XP computer. The program is compiled as managed code with a target of AnyCPU.

The same program is run on a 64-bit Windows 7 computer and a .NET StackOverflow Exception occurs on a PERFORM statement in the program.
The program has a large number of PERFORM and PERFORM THRU statements.

Why does it run fine on a 32-bit computer but fails on a 64-bit computer?

Resolution:

The amount of stack space used in a 64-bit program is about double that of a 32-bit version. There are two known resolutions to this issue:

1.  Using the Configuration Manager, change the target type of the project from AnyCPU to x64.
2.  Try adding the compiler directive PERFORMTYPE(VSC2) to the project properties under the COBOL tab.
Incident #2499057