I have a related problem using EViews 10+. When calling a subroutine within a subroutine, EViews occasionally crashes. The problem seems to be related to the number of maximum allowable errors. When setting the number manually to 100 (in EViews, via General Options) and in the subroutine to 1 (SetMaxErrs 1) I get a message that the number of maximum allowable errors has been exceeded. Then I remove the code snippet (SetMaxErrs 1) and run the program again and everything works well. Then I close EViews and run the program again, with the same options and without changing anything, and EViews crashes.
I am using Windows 10 and from the Event Viewer I got the information that the error arose from module "evCommon.dll". Not sure if that information is helpful.
In another program (that includes subroutines) I have experienced random crashes that seems to be unrelated to the actual code, as EViews on one occasion crashes at a certain position in the program, but the next time does not but is able to continue past that position. However, then it crashes at the last line which is a simple "Statusline". Sorry for the bad description, but it seems to happen unsystematically.