Dear all,
up to a week ago I was perfectly able to compile and debug a Fortran code with Visual Studio 2013, paralleziled with openMP, but now, when debugging, I get the error message:
Debug assertion failed!
Program:*\mycode.exe
File:f:\dd\vctools\crt\crtw32\misc\winsig.c
Line:418
Expression: invalid signal or error.
This happens only when debugging because the executable is actually working nicely. Moreover I have no error message on the command window. I haven't change any settings in VS.
Could you please help me to figure out what can cause the problem?
Thanks
連結已複製
From the research I have done, it seems likely that you have some large static variables that parallelization will cause to go on the thread stack. The suggestion is to make these allocatable instead. It would be helpful to use the stack frame list in the debugger to see where your program was executing when the MSVC library (used underneath the Fortran/OpenMP library) found a problem. You see this only when debugging as that's when asserts happen.
http://stackoverflow.com/questions/5795938/stack-overflow-in-fortran90 has discussion of this issue.
Thank you Steve for your reply. However, I still cannot solve the problem because the error message occurs just after (or even before, I cannot say) the call of modules, i.e. "use module1"..., which contains ONLY allocatable array, no static variable is used. The first instruction of the code is a "write" and it even does not do this one. On the top of this, I have colleagues which are debugging the same code with no problem using the same version of Visual Studio.
Might it be a conflict or something else related with windows update or java?
USE statements are not executable. You may simply be running out of stack when you enter a procedure. Try adding /heap-arrays to the Fortran compile command line (in VS, Fortran > Optimization > Heap Arrays > 0.)
I found the soure of my problem: it was a conflict with the antivirus Baidu. Fortunately no problem with the code, neither with Visual Studio, but a conflic between programs. It has been really hard to find because no message was give to suspect the cause of the problem.
Thanks again for the support.