Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Unexpected access violation

Roman1
New Contributor I
785 Views

I am using the latest: Fortran Compiler XE 14.0.3.202

The program I am working on has started unexpectedly crashing when compiled in optimized release mode.  However, when compiled in debug mode, there are no errors or warnings.  I have spent a day debugging, and I was able to isolate the portion of the code where the problem occurs.  This code is very unstable, and doing a trivial change can make the problem go away.

Attached is the source code, project, and output BuildLog files.  When compiled in release mode, the program crashes with:
forrtl: severe (157): Program Exception - access violation


Roman

 

0 Kudos
6 Replies
Steven_L_Intel1
Employee
785 Views

I'm looking at this now. Seems that the optimizer has moved some code that references an omitted argument outside the if(present) test for that argument. Not nice.

0 Kudos
Steven_L_Intel1
Employee
785 Views

Escalated as issue DPD200359189. /Qopenmp is required to trigger the error. I will let you know here of any progress on the bug.

0 Kudos
Roman1
New Contributor I
785 Views

Thanks for looking at this.  Initially, I was concerned that there was a bug in my fortran code.  Until the compiler is fixed, do you know of a safe way of getting around this problem?  I don't want to disable /Qopenmp since there is parallelization in some of the subroutines, and I am using pardiso from MKL.  While debugging, I noticed that if in fwd_model.f90, I declare the 'is' variable with a SAVE attribute, it doesn't crash.

integer,save:: is

Do you think this would be safe for now, or would it move the problem somewhere else?

Roman

 

0 Kudos
Steven_L_Intel1
Employee
785 Views

I found that all sorts of small modifications made the error go away. A simple one would be to reduce the optimization level on fwd_model.f90 without changing the code. I would be hesitant about adding SAVE declarations on code that is executed in parallel regions.

0 Kudos
John_Campbell
New Contributor II
785 Views

I looked at the attachment in Quote #1 and found:

beta_range.f90    call fwd_model( )

fwd_model.f90  subroutine fwd_model(dpred)

Although routine fwd_model is contained, isn't there an argument mismatch ?
I would have expected this to be wrong in Fortran 95.

John

0 Kudos
mecej4
Honored Contributor III
785 Views

John, please look at the code again. In subroutine FWD_MODEL, the argument DPRED is declared OPTIONAL.

0 Kudos
Reply