Commodore
Commodore
283 views

Stack Overflow Exceptions

Jump to solution

I am getting a Stack Overflow exceptions in my Managed COBOL project. I read an article regarding this problem on the Micro Focus Community forum at the following link: https://community.microfocus.com/t5/Visual-COBOL-Knowledge-Base/Diagnose-and-fix-Stack-Overflow-exceptions-in-Visual-COBOL/ta-p/1743761#

I experienced this problem a couple of weeks ago and manage to circumvent it by changing the code. But I am getting it again and it is happening in complex nested code that I cannot easily change.


Based on the articles, it seems all that may be required is that I increase the stack size allocation. These are the following steps a tried as instructed by the article in order to increase stack space:
1) Enable mixed-mode debugging in the project property
2) Attempted to do a stack analysis using the “.load sos” extension but it did not recognize the “.load sos” command.


I am using Micro Focus VISUAL COBOL 5.0  with patch update 10 and Microsoft Visual Studio Community 2019 Version 16.6.2 S.

0 Likes
1 Solution

Accepted Solutions
Micro Focus Contributor
Micro Focus Contributor

Hi Alex, unfortunately the SoS debugger extension is not supported in recent versions of Visual Studio. It will still be supported in WinDBG so you could use that as an alternative.

View solution in original post

0 Likes
2 Replies
Micro Focus Contributor
Micro Focus Contributor

Hi Alex, unfortunately the SoS debugger extension is not supported in recent versions of Visual Studio. It will still be supported in WinDBG so you could use that as an alternative.

View solution in original post

0 Likes
Commodore
Commodore
I solved this problem by adding ‘ILSTACKSIZE(99097152)’ in the ‘ Additional directives’ under Project/Properties/COBOL. What this did is essentially increased the stack space. The original articles I included in this thread suggested this as a possible solution but I somehow missed it. I re-read the article again and that is when I notice that I had not tried this solution.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.