Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

winsig error

DavidWhite
Valued Contributor II
937 Views
Can anyone help with this problem? I believe it is to do with incorrect arguments on a subroutine call, but the breakpoint isn't in my code and doesn't make sense.

Thanks,

David

forrtl: severe (170): Program Exception - stack overflow
Image PC Routine Line Source
testbayer.exe 0051D4C7 Unknown Unknown Unknown
testbayer.exe 004C1266 _MAIN__ 261 testdll.for
testbayer.exe 0057CAA3 Unknown Unknown Unknown
testbayer.exe 0051DB53 Unknown Unknown Unknown
testbayer.exe 0051D91D Unknown Unknown Unknown
kernel32.dll 7C816FD7 Unknown Unknown Unknown


Break on winsig.c line 419:
_VALIDATE_RETURN(("Invalid signal or error", 0), EINVAL, SIG_ERR);
/* should never happen, but compiler can't tell */

0 Kudos
6 Replies
Jugoslav_Dujic
Valued Contributor II
937 Views
Quoting - David White

testbayer.exe 004C1266 _MAIN__ 261 testdll.for

Last known code of yours is line 261 in the main program.


Judging from the source file name, it's a call to a dll routine? Since the call stack does not include any dll code, it's plausible that you got the calling sequence wrong, as you suspected.

0 Kudos
DavidWhite
Valued Contributor II
937 Views
Quoting - Jugoslav Dujic

Last known code of yours is line 261 in the main program.


Judging from the source file name, it's a call to a dll routine? Since the call stack does not include any dll code, it's plausible that you got the calling sequence wrong, as you suspected.


Yes, I was trying to test a DLL. However, I have now added the source files to my project, so that I have
testdll.for - main program
bayervb.f90 - visual basic interface routine with DLL EXPORT directives
bayer.for - main calculation routine, which is called by bayervb when called from Excel, but called directly from testdll in this implementation.

Excel version works perfectly. I can't get this fortran stand-alone version to work. I can't work out why the break occurs in the winsig.c routine, which is presumably part of IVF.

Thanks

David
0 Kudos
Steven_L_Intel1
Employee
937 Views
winsig.c is in the Microsoft C library. You'll get this particular extra error if building with debug libraries and an exception is signalled that the MSVC libraries don't understand. Just ignore the winsig.c part and concentrate on the stack overflow.

Most likely you have an automatic array that gets stack allocated by default, and you've overflowed the default 1MB stack. Presumably, Excel is built with a larger stack. You can build your EXE with a larger stack (Linker > System > Stack Reserve Size) or use Heap Arrays: 0 to have these arrays allocated dynamically.
0 Kudos
Vinod
Beginner
937 Views

Dear Steve,

I have the same problem with my code. I have some variables which are dynamically allocatated. They are shared by different subroutines using modules. 

The program works perfect for small problems. However, as I changes the size of problem, which consequently increased the memory requirements by the variables. 

I was trying to follow your advice give above, change the stack or heap reserve size, which is by defaut 0. I was wondering what values should be there?

I was looking for it but could not find it. Could you please tell me how the values should be specified, such in kb,MB or something else?

Waiting for your reply. 

Regards,

Vinod

0 Kudos
Vinod
Beginner
937 Views

Dear Steve,

I have already solved the problem after setting the value at 8000000.

But thanks anyway.

Regards,

Vinod

0 Kudos
Bernard
Valued Contributor I
937 Views

Breakpoint is trigerred inside winsig library which your code could have been linked to directly or indirectly.As Steve said the problem lies in stack overflow and it was solved in case of Vinod.

0 Kudos
Reply