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

problem running Intel Visual Fortran Project Release version in Windows 7.

farukhsharipov
Beginner
769 Views
Hi everyone
I have Intel Visual Fortran Project which runs without issues in Debug configuration mode. But now I would like to build Release version and deploy it. So I set configuration to Release and build it. Once it done building I try to run it without Debuging and I get this screen38646-3.jpg
So now I go to Release folder right click on PSI_Mesh_Generator.exe -> Properties ->Compatibilitytab
Compatibility mode -> check Run this program in compatibility mode for: Windows XP (Service Pack 2) -> click ok try to run the program.
Now it works fine.
Just to be cleare I have in Visual Studio IDE in Project Properties -> Command Line:
[bash]/nologo /module:"Release\\" /object:"Release\\" /Fd"Release\vc100.pdb" /libs:static /threads /c[/bash]
dumpbin /dependents PSI_Mesh_Generator.exegives me:
[bash]Microsoft  COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file PSI_Mesh_Generator.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    KERNEL32.dll
    imagehlp.dll

  Summary

       11000 .data
       1D000 .rdata
        D000 .reloc
        1000 .rsrc
       C4000 .text
        1000 .text1
        1000 .trace
[/bash]
One more thing this project was created on Windows XP 32 bit but now I moved to Windows 7 64 bit.
If anyone can point me to the right derection why this is happening I would appriciate that.
Thanks in advance.
0 Kudos
13 Replies
Steven_L_Intel1
Employee
769 Views
First thing I would do is enable Traceback so you can see exactly where this is happening. Without that, you're completely in the dark.

Write back when you have the location information and can show us what it is doing there.

One thing Windows 7 does is "address space layout randomization" which causes dynamic allocations (and DLL loads) to be at different addresses from run to run. You may have a coding error that is accessing through a bad pointer or something similar.
0 Kudos
farukhsharipov
Beginner
769 Views
Thank you for your reply.
How do you enable Traceback in Microsoft Visual Studio IDE ? I tried to add/traceback into Project -> Properties -> Linker -> Command Line -> Additional Optons:/traceback

But it gives me
[bash]1>LINK : warning LNK4044: unrecognized option '/traceback'; ignored[/bash]
0 Kudos
Steven_L_Intel1
Employee
769 Views
Fortran > Run-Time > Generate Traceback Information > Yes

0 Kudos
farukhsharipov
Beginner
769 Views
Thank you. Now I get this:


I am looking at the WriteToFile3D.f90 line 1692 and i just have the loop there which should be fine..
[fortran]        Do i=1,NumberOfMaterials
        
            Write(88,299)i,YoungsModulus(i),PoissonsRatio(i),1e25,0 !<- Line 1692
    
        Enddo
[/fortran]
Is the problem with this loop or something else ?
0 Kudos
bmchenry
New Contributor II
769 Views
what is the file for unit 88?
by chance have you opened the file?
particulalry have you opened it with excel or some spreadsheet program that takes exclusive rights?
close it from excel and then see what happens.
Access violation type errors i normally see when i'm looking at a file from excel and forget to close before running the program.
(of course you should have a check in your program that it is available to be written to before trying to write to it, but that's another issue)

0 Kudos
Steven_L_Intel1
Employee
769 Views
This type of "access violation" has nothing to do with files - it is a memory issue. (See Don't Touch Me There - What error 157 (Access Violation) is trying to tell you) The program is accessing an undefined piece of memory. This could be due to an array bounds error or something else. With the line you show there, my guess is that "i" is an invalid value for the array, or perhaps the array was passed incorrectly.

Let me suggest two things to try. One, turn on String and Array Bounds Checking under Fortran > Run-time and see if any new errors appear. Two, set the property Fortran > Optimization > Heap Arrays to 0 and see if that changes anything.
0 Kudos
farukhsharipov
Beginner
769 Views
Thank you for your respond.
I tried to enable Fortran -> Run-time -> Check Array and String Bounds
I got this message which look simular to what I had befoure.
Then set Fortran -> Optimization -> Heap Arrays to 0 nothing changed, same error message.
I have one question if this is memory access violation why then it dosn't show up during debug mode ? Or why it works fine under Windows XP ?
0 Kudos
mecej4
Honored Contributor III
769 Views
You have an error in your program: an array subscript has a value higher than the limit allocated for that array. The behavior of a program with subscript overruns is undefined. That means that anything can happen. What happens can vary from run to run, from compiler to compiler, operating system to operating system, or day to day.
Find out why the subscript error occurs and fix it.
0 Kudos
JohnNichols
Valued Contributor III
769 Views
Dear While(alive)work++

I have slowly worked through this type of error from very old programs as they are moved onto newer compilers.

The problem is that something that is not strictly legal would work on one compiler and then the next compiler would tag it as an error. Often array boundaries caused me the greatest problem.

I have a program written in 1966 at Berkeley, it has to have been run on at least a dozen compilers, I have some input and output files from the late 70's that show the program is "working" ok.

But the latest iteration of the IVF-- picked up quite a few errors, which were obvious once pointed out to me.

I did not write the code merely got it from punch cards in the 1980's from my old boss who did a Masters in Structures at UCB.

I think the compiler that identified the greatest number of these hard to spot errors was Powerstation. It was a big step forward, but I hated it with a passion as one was on one's own in Australia and the error codes were obscure in the beginning. I can remember taking days to track down some errors.

I used to use print statements and write out the variables.

Life is much better with the Internet, Steve, and IVF and this lot of humans.

I well remember learning Lisp in Autocad 2.18 with just the list of commands. It was not fun.

JMN



0 Kudos
farukhsharipov
Beginner
769 Views
Thank you all for suggestions
So if I understand correctly I need to go back and check my code line by line and try to find what I am doing not strictly correct.....
If anyone else have better ideas how to deal with this type of problem please feel free to share with your ideas.
NOTE: I used exact same executable on Windows XP and it worked even that I compiled it under Windows 7.. Very frustrating that it works fine under debug mode too....
0 Kudos
Steven_L_Intel1
Employee
769 Views
I suggest adding some PRINT statements that show you how i is getting its value and where the bounds of the array come from. This should be a straightforward thing to test. Oh, and you should verify that you have bounds checking enabled for the debug build. I'm guessing you do not.
0 Kudos
mecej4
Honored Contributor III
769 Views
> So if I understand correctly I need to go back and check my code line by line ..

Only if you insist!
The compiler told you which subscript exceeded its bound in which line of which source file. That would be the place which I would examine for errors, and then look at other lines/source files as needed.
In many ways, an error that does not reveal its presence (by giving recognizably incorrect results) is worse than a blatant error.
0 Kudos
JohnNichols
Valued Contributor III
769 Views
1. Accept that life is short
2. no code is perfect
3. Compilers will change
4. Fix the errors as you find them, do not make workfor yourself.
5. Follow the Australian Army Rule.

JMN
0 Kudos
Reply