On Windows the stack is 1MB by default, so it's easy to overflow this. The compiler has to create space for this and does so on the stack by default. Your function returns an array whose size is run-time dependent on the size of its argument. Real(kind = 8), dimension(size(A,1),size(A,2)) :: AfuncĪttached are the two txt files, one with an array 300x300 and the other with an array 400x400.Īttached are also two printscreens with the errors that appear when the program makes the operation with the array 400x400, one when is compiled in 32-bit and the other in the 64-bit. Real(kind = 8), dimension(:,:), intent(in) :: A Open(100, file='matrix300.txt', status='old')Īnd the following code to the module with the function: module mod_example_function Real(kind = 8), dimension(:,:), allocatable :: A, Afunc I am using the following code to the main program: program stack_overflow_error
![intel c compiler stack overflow intel c compiler stack overflow](https://ars.els-cdn.com/content/image/3-s2.0-B9780128207352000111-f11-09-9780128207352.jpg)
#INTEL C COMPILER STACK OVERFLOW UPDATE#
The university computer that I am using has installed Microsoft Visual Studio Professional 2013 Update 3, Intel Parallel Studio XE 2016 Update 2 Cluster Edition for Windows. Has anyone experienced this same problem? What can I do to solve this error? Is there any compiler option to solve this problem? I even compiled on two different computers with different versions of Visual Studio and Intel Parallel Studio and the error remains the same.
![intel c compiler stack overflow intel c compiler stack overflow](https://i.stack.imgur.com/Yx84K.png)
I reduced and generalized the code to find where the error is and even then the problem reoccurs. The problem occurs only with arrays larger than 300x300. I have been having problems with stack overflow error when I am trying to operate arrays through a function implemented in a module.