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

FORTRAN Runtime Error

jph
Novice
862 Views

I 'inherited' some FORTRAN/IMSL code that I can get to compile and link cleanly, but am getting the error below at runtime, for both the 'Debug' and 'Release' versions of the *.exe file ... this is my first FORTRAN application and I will confess to being a definite 'novice' in the "FORTRAN' department ... here's the error msg:

'The procedure entry point for_allocate_handle could not be located in the dynamic link library <path to exe>\<name of executable>.exe

If I try to run the (Debug) version within the IDE (MS Visual Studio Professional 2022, version 17.9.2), Intel FORTRAN Compiler 2024.0), I get an 'Unhandled Exception Stack Overflow' error on the 'PROGRAM' statement. I'm running this on a machine not connected to the internet, so it would take 'awhile' to paste in (er, retype) all of the messages that are dumped out to the 'Output' tab in the IDE, although I could do that (I think) with some effort. There are several references to 'Win32' though--not sure whether this could be causing the problem as I thought that this was a 64-bit application.

Any help would be greatly appreciated--I'm just not sure where to start at this point. Thanks.

 

Joe

Labels (1)
0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
692 Views

Things to try:

  • Set the option Fortran > Optimization > Heap Arrays to 0 (zero)
  • Set the option Linker > System > Stack Reserve Size to 100000000

 

View solution in original post

10 Replies
Steve_Lionel
Honored Contributor III
845 Views

You seem to have several things going on.

The first message you describe about for_allocate_handle is a bit strange. That is the name of a procedure in the Intel Fortran run-time library, typically accessed from libifcorert.dll. Perhaps you transcribed the error incorrectly, as it should not name your executable as where it was looking for the function. Note that you will not be able to run a Debug configuration executable outside of the Visual Studio environment.

The first thing I would try is to build a "hello world" program in Visual Studio and run it there.  Create a new project and select the project type Fortran > Main Program Code. Build that and run it from within Visual Studio (I suggest using Debug > Start without debugging (CTRL-F5), otherwise you won't get to see the output.

Did you inherit the Visual Studio project that builds this application? It may have set some inappropriate values for the link properties that lead to the stack overflow error.

Most of those messages you see when starting a program in the debugger can be ignored.

As for 32-bit vs. 64-bit, this would be controlled by the build configuration, Win32 vs. x64.

jph
Novice
731 Views

Steve--

thanks so much for your help: I did verify that I could build/run 'hello world' and also determined that there was an issue reading an updated IMSL license file, which I corrected. So now, the 'Release' version (in MS Visual Studio 2022, 17.9.2 and Intel FORTRAN Compiler ifx 2024.0) of this code builds and runs (x64) ... however, I'm having issues with the 'Debug' (also x64) version (which is the version that I sort of need to run) ... I'm getting the error "forrtl: severe (170): Program Exception - stack overflow" when I attempt to run the Debug version, which was created with the same source as the Release version. I was attempting to match the compiler settings (between 'Release' and 'Debug') but so far cannot seem to get rid of this error. Unfortunately, this code is running on a 'standalone' system--I could probably retype some selected excerpts of the code if that would help, but I was hoping that there might be some compiler setting that should be set differently for Debug as compared with Release? Thanks again for your help!

Joe

0 Kudos
mecej4
Honored Contributor III
719 Views

Some progress could be made if you could provide the source code of your test program (along with data files, if any are needed). Quite frequently, "stack overflow" is easy to diagnose and remedy if the source code is available. Sometimes, however, errors in the program can cause the program to abort with stack overflow, but simply increasing the stack size may not solve the problem. Need the source.

0 Kudos
Devorah_H_Intel
Moderator
692 Views

@jph 
If security is a concern - submit a support request via a secure Online Service Center.

0 Kudos
Steve_Lionel
Honored Contributor III
693 Views

Things to try:

  • Set the option Fortran > Optimization > Heap Arrays to 0 (zero)
  • Set the option Linker > System > Stack Reserve Size to 100000000

 

jph
Novice
674 Views

I had previously tried the Heap Array setting the Heap Array to 0 but did not know about setting the stack reserve size--that solved the problem ... thank you so much! beaucoup kudos!!

Steve_Lionel
Honored Contributor III
661 Views

Be careful with that setting and don't make it excessively large, or else your program won't start. 

jph
Novice
562 Views

well, now that I can run the debug version of this code, I'm having some issues setting breakpoints in the debugger--I can click on the line on which I'm trying to set a break and the red, filled in circle appears (F9 also does this) ... however, when I attempt to run the program in the debugger, it seems to skip all of the breakpoints and (attempts to) run to the end--is there some 'setting' that I need to use to have it recognize breakpoints? sorry--I have used VS before, but not recently ... thanks (again)

 

Joe

0 Kudos
jimdempseyatthecove
Honored Contributor III
398 Views

Check the Configuration Manager and assure that the Build check box is checked for the configuration you are building. If it is not, you may be linking an older version of an object file into the executable.

 

jimdempseyatthecove_0-1715949231410.png

Jim Dempsey

0 Kudos
Steve_Lionel
Honored Contributor III
544 Views

This is a debug build?  Is this just an executable, or a DLL that is called from something else? Please show a screenshot of the entire VS window with the breakpoint visible.

0 Kudos
Reply