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

odd problem

lklawrie
Débutant
4 127 Visites

Large project -- getting an access violation with certain compiler settings.

If try to put it in debugger or add any checks (i.e. array bounds, etc), it runs.  Adding /fpe:0 and it runs. 

I'd like to say it's a compiler issue but?

0 Compliments
43 Réponses
lklawrie
Débutant
1 414 Visites

"faulting ip"?  Please be clear in what you are requiring/suggesting.  And why is it fine in Win32 but not x64?

0 Compliments
Steven_L_Intel1
Employé
1 414 Visites

Different architectures mean different memory layout, different instructions, etc. "faulting IP" means the instruction pointer of where the error occurred. Technically, you have that already as its in the traceback.

So now we know that the source line of the error is:

  5409              FinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq(TimeStepIndex) = &
   5410                FinalZoneSizing(CtrlZoneNum)%CoolZoneTempSeq(TimeStepIndex) + RetTempRise * &
  >5411               (1.d0/(1.d0+TermUnitSizing(CtrlZoneNum)%InducRat))

but we don't know which part of this statement is the problem. realistically, it will be either FinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq(TimeStepIndex) or TermUnitSizing(CtrlZoneNum)%InducRat). What I would do, as an experiment, is declare a temporary variable, say, temp, and assign TermUnitSizing(CtrlZoneNum)%InducRat)) to it before this statement, then substitute temp in the expression. Do you still get the error? Does the error move? If the error still exists but doesn't move, then FinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq(TimeStepIndex)  is probably the problem - you'd have to figure out which part of this is wrong.

0 Compliments
lklawrie
Débutant
1 414 Visites

There is no longer an error in that case.  now what?  And, as I've said before, if you don't change the statement but print something before it (didn't try printing after) -- the file runs.

0 Compliments
Steven_L_Intel1
Employé
1 414 Visites

If I had the program here, I'd step through the instructions in the debugger to see what it is doing. It's not something I could easily walk you through.

0 Compliments
lklawrie
Débutant
1 414 Visites

Where would you like me to put it?  I can zip up the object/source/project.  It will be quite large. 

I have to backtrack on my previous statement -- it does now terminate where it says:

temp=termunitsizing

I had inadvertently added a "if (allocated(termunitsizing)) stop" statement above that -- and it caused it to run.

maybe i can work with it further.

0 Compliments
lklawrie
Débutant
1 414 Visites

Still no help -- now inspector says it fails there but the debugger information is not helpful (due to the optimization, I'm sure).

Where would you like a zip file, Steve?

0 Compliments
Steven_L_Intel1
Employé
1 414 Visites

Please use Intel Premier Support and ask that the issue be assigned to me.

Try building with /standard-semantics (Fortran > Language > Enable F2003 Semantics)

0 Compliments
lklawrie
Débutant
1 414 Visites

I am building with F2008 semantics.  I did manage to get the compiler / debugger to show that the index of that structure was 0 -- however it is inside a specific loop with that index as a loop control variable.

It may take a while to make it so you can see it -- but to me, it seems like a compiler bug.

0 Compliments
Bernard
Précieux contributeur I
1 414 Visites

lklawrie wrote:

"faulting ip"?  Please be clear in what you are requiring/suggesting.  And why is it fine in Win32 but not x64?

Sorry for not providing enough expalnation.Faulting ip = instruction pointer which caused some fault or exception.

0 Compliments
Bernard
Précieux contributeur I
1 414 Visites

Please proceed exactly as Steve advised.Run your program under debugger(first source-level) step in on every instruction and inspect the memory beign read/written pay attention to any pointer dereferences.If this will not be helpful machine code level debugging with the help of application verifier should be used to test your app.

0 Compliments
SergeyKostrov
Précieux contributeur II
1 414 Visites
>>...Large project -- getting an access violation with certain compiler settings... Linda, The thread is already 5-day-old and why woudn't you post a complete set of compiler settings for a review?
0 Compliments
lklawrie
Débutant
1 414 Visites

Issue 698745 posted.  Steve, it's set to run with break at the place where it will most likely crash.

No one asked for compiler settings. Compiler settings:

Compiler:
/nologo /debug:minimal /O2 /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc90.pdb" /traceback /libs:static /threads /c
pasted to command line window (from others)
/nologo /fpp /stand:f08 /Qdiag-disable:5268 /fpscomp:none /nogen-interfaces /F8388608 /DWINDOWS /O2 /DNDEBUG

Linker:
/OUT:"x64\Release\Console3.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"C:\Users\lklawrie\Documents\Visual Studio 2008\Projects\Console3\x64\Release\Console3.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\lklawrie\Documents\Visual Studio 2008\Projects\Console3\x64\Release\Console3.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\lklawrie\Documents\Visual Studio 2008\Projects\Console3\x64\Release\Console3.lib" /STACK:8388608

0 Compliments
Steven_L_Intel1
Employé
1 414 Visites

Thanks - I got it. I will get to it soon.

0 Compliments
SergeyKostrov
Précieux contributeur II
1 414 Visites
>>...Adding /fpe:0 and it runs... Thanks for the command line options and I'd like to confirm that you have Access Violations in Release Configuration only. I think your workaround is very interesting and why did you decide to use 0?
0 Compliments
Steven_L_Intel1
Employé
1 414 Visites

/fpe:0 changes the choice of instructions used. 3 is the default and the only other choice is 1, which hardly anyone bothers with. (2 was suppported with DEC compilers.) It does seem that most anything that changes the instruction stream makes the problem "go away" based on what Linda has said to date.

0 Compliments
Bernard
Précieux contributeur I
1 414 Visites

So Linda do you have av exception in debug or in release mode?

0 Compliments
lklawrie
Débutant
1 414 Visites

only in release mode, only with the particular compiler settings shown.

0 Compliments
Bernard
Précieux contributeur I
1 414 Visites

Strange because rigorous stack checking is relaxed in release mode.Have you tried to step-in through the code?

0 Compliments
SergeyKostrov
Précieux contributeur II
1 414 Visites
>>... Adding /fpe:0 and it runs... Steve, I see the following in Fortran compiler help: ... /fp: name enable floating point model variation except[-] - enable/disable floating point semantics fast[=1|2] - enables more aggressive floating point optimizations precise - allows value-safe optimizations source - enables intermediates in source precision strict - enables /fp:precise /fp:except, disables contractions and enables pragma stdc fenv_access ... and I don't see any numeric values similar to what Linda uses.
0 Compliments
SergeyKostrov
Précieux contributeur II
1 360 Visites
>>... I don't see any numeric values similar to what Linda uses... Sorry, I missed it... Please ignore my previous post.
0 Compliments
Bernard
Précieux contributeur I
1 360 Visites

Linda any updates related to your project?

0 Compliments
Répondre