Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Important Update: Community Platform Migration​. Learn more​>
29649 Discussions

FPE - traceback - problems on WINDOWS 7

dajum
Novice
1,212 Views
If I hit a divide by zero in my code with /fpe:0 and /traceback in the compile/link switches I expect to see the error messages and traceback. But now running on WINDOWS 7 ( and VISTA I guess in the past), I get the windows dialog that says my ".exe has stopped working A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." How can I avoid this so I see the traceback written out as usual. Note that we run the executable from another program and not a command prompt. The messages are captured and displayed via a file.

0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,212 Views

Just tried this on my Win7 system:

E:Projects>type test.f90
real x,y
accept *, y
print *, x/y
end
E:Projects>ifort /fpe:0 /traceback test.f90
Intel Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1 Build 20090903 Package ID: w_cprof_p_11.1.046
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Microsoft Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

-out:test.exe
-subsystem:console
-incremental:no
test.obj

E:Projects>test.exe
0
forrtl: error (65): floating invalid
Image PC Routine Line Source
test.exe 00401077 _MAIN__ 3 test.f90
test.exe 004622E3 Unknown Unknown Unknown
test.exe 004464E8 Unknown Unknown Unknown
kernel32.dll 760F3677 Unknown Unknown Unknown
ntdll.dll 77119D72 Unknown Unknown Unknown
ntdll.dll 77119D45 Unknown Unknown Unknown

0 Kudos
dajum
Novice
1,212 Views

Did you read to the bottom of my post? I specifically said I don't run from a command prompt. That makes all the difference. Yes it works fine if I run from a command prompt. The question is what causes windows to do capture this and put out it's own dialog box.Hopefully someone knows why this happens. The same executables and code are used on all the other test cases, which typically work fine and capture the FPE, the only variable is that the executable generating the FPE is compiled and linked on the test platform. This does mean that there can be differences in the setup for the compiler used on the test platform.

Dave

0 Kudos
Steven_L_Intel1
Employee
1,212 Views

Ah, I see. Windows doesn't do this - the Fortran run-time exception handler does, and that works only when the main program is Fortran. Is your Fortran code in a DLL? I am not sure what you mean by it being run "from another program".
0 Kudos
dajum
Novice
1,212 Views

Ah, I see. Windows doesn't do this - the Fortran run-time exception handler does, and that works only when the main program is Fortran. Is your Fortran code in a DLL? I am not sure what you mean by it being run "from another program".

The main program that issues the FPE is FORTRAN. But we have a dll that we interface to codes like AutoCAD, that does a CreateProcess and executes the Fortran program in a shell, so in a sense it is executed from AutoCAD or other codes. I didn't generate that dll, so I don't know exactly what is in it. But it seems to work fine in XP, and usually in VISTA, and older OSs.
0 Kudos
Reply