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

Internal compiler error (C0000005)

Marat_S_1
Beginner
1,463 Views

I have just upgraded Fortran Compiler to 2013 SP1 and my project is not compiled anymore. However, I believe the code is correct. 

[fortran]

module TimeMod
implicit none
private
type, public :: TimeType
private
character(len=1) :: dummyChar
contains
procedure, private, nopass :: GetDateTime => GetDateTime
end type TimeType
contains
function GetDateTime() result(dateTimeString)
character(len=19) :: dateTimeString
dateTimeString = ''
end function GetDateTime
end module TimeMod

module AMod
implicit none
private
type, public, abstract :: AInterface
private
character(len=1) :: dummyChar
end type AInterface
end module AMod

module BMod
implicit none
private
type, public :: BType
contains
procedure :: ComputeSomething => ComputeSomething
end type BType
contains
function ComputeSomething(this, time) result(something)
use TimeMod
class(BType), intent(in) :: this
type(TimeType), intent(inout) :: time
real*8 :: something
something = 0.0d0
end function ComputeSomething
end module BMod

module CMod
use AMod
use TimeMod
use BMod
implicit none
private
type, public :: CType
private
type(BType) :: b
class(AInterface), allocatable :: a
contains
procedure :: DoSomething
end type CType
contains
subroutine DoSomething(this, id, time)
class(CType), intent(inout) :: this
integer, intent(in) :: id
type(TimeType), intent(inout) :: time
print *, 'ok'
end subroutine DoSomething
end module CMod

module DMod
use CMod
use TimeMod
implicit none
private

interface
subroutine DoIt(ptr, id, time)
use CMod
use TimeMod
type(CType), pointer, intent(in) :: ptr
integer, intent(in) :: id
type(TimeType), intent(inout) :: time
end subroutine DoIt
end interface

type, public :: DType
private
type(CType) :: array(20)
contains
procedure :: DoSomething => DoSomething
procedure :: DoForAll => DoForAll
end type DType

contains

subroutine DoSomething(this, id, time)
class(DType), intent(inout) :: this
integer, intent(in) :: id
type(TimeType), intent(inout) :: time

call this%array(1)%DoSomething(id, time)

end subroutine DoSomething


subroutine DoForAll(this, method, time)
class(DType), target, intent(in) :: this
procedure(DoIt) :: method
type(TimeType), intent(inout) :: time
type(CType), pointer :: ptr

ptr => this%array(1)
call method(ptr, 1, time)

end subroutine DoForAll

end module DMod


program DELME
use DMod
use TimeMod
type(DType) :: d
type(TimeType) :: t
call d%DoSomething(1, t)
end program DELME

[/fortran]

0 Kudos
12 Replies
Steven_L_Intel1
Employee
1,463 Views

Thanks - I have escalated this as issue DPD200249466 and will let you know of any progress. The statement that triggers the error is:

call this%array(1)%DoSomething(id, time)

0 Kudos
Bernard
Valued Contributor I
1,463 Views

Looks like access violation error.

0 Kudos
Marat_S_1
Beginner
1,463 Views

Steve Lionel (Intel) wrote:

Thanks - I have escalated this as issue DPD200249466 and will let you know of any progress. The statement that triggers the error is:

call this%array(1)%DoSomething(id, time)

 

Hi Steve,

Any information on when it will be fixed?

0 Kudos
Steven_L_Intel1
Employee
1,463 Views

It's still being worked on. I don't have an estimate at present.

0 Kudos
Steven_L_Intel1
Employee
1,463 Views

The developers have fixed this, but the fix missed the deadline for update 2. I expect it to make update 3.

0 Kudos
nariman_k_
Beginner
1,463 Views

hey i;m using mocrosift developer studio fortran 90 for my final project code and i encountered  the same error:

unhandled execption in "hydroplainchannel.exe"(HYDROP~1.exe):

0×C0000005:Access Violation.

why this error occurs and what should i do to solve this error

tnx in advance

 

0 Kudos
Les_Neilson
Valued Contributor II
1,463 Views

nariman k. wrote:

hey i;m using mocrosift developer studio fortran 90 for my final project code and i encountered  the same error:

unhandled execption in "hydroplainchannel.exe"(HYDROP~1.exe):

0×C0000005:Access Violation.

why this error occurs and what should i do to solve this error

tnx in advance

 

 

Apart from actual logic errors the usual problems causing Access Violations are :

Uninitialized variables, subscript out of range, mismatched arguments.

As a start you should recompile your code with all of the compile time and runtime error checking options on. (e.g. /check:all)

Also look at the "traceback" option which helps identifying where an error occurs.

Les

0 Kudos
TimP
Honored Contributor III
1,463 Views

There hasn't been much discussion lately about how to use the Microsoft Fortran of 17 years ago. Its deficiencies might be compounded, if anything, by running on versions of Windows which weren't in the planning stage when that project was abandoned.  If you aren't prepared to guess whether the problem lies in your own program, in the compiler, or in attempting to use the compiler on a more recent Windows, speculation on our part isn't likely to help.

0 Kudos
mecej4
Honored Contributor III
1,463 Views

Nariman K: There is a major difference between the topic of this thread and the topic of your post. Marat S. reported an access violation by the Intel compiler in the course of compiling his Fortran source code. Your problem is with your own EXE (which was compiled using a really old and known-to-be-buggy compiler) causing an access violation. Marat S.'s problem requires fixing bugs in the compiler. Your problem requires fixing bugs in the sources used to build hydroplainchannel.exe, and it serves no useful purpose to confuse the two issues.

0 Kudos
Bernard
Valued Contributor I
1,463 Views

@Nariman

Regarding your question related to access violation error culprits I would like to add also as root cause of this error issues like: referencing unmapped dll's, dereferencing pointers which hold the address of uninitialized variables,improperly cleaned stack when some junk is referenced.In order to investigate that issue you can inspect minidump files.

 

 

0 Kudos
FortranFan
Honored Contributor III
1,463 Views

Tim Prince, mecej4:

nariman k. wrote:

hey i;m using mocrosift developer studio fortran 90...

Do you have more information than posted on this forum post?  Otherwise, how do you conclude from this that he is using "Microsoft Fortran of 17 years ago" or ".. was compiled using a really old and known-to-be-buggy compiler"?

Did "Microsoft Fortran" ever include support for Fortran 90?

Isn't "developer studio" used interchangeably with Microsoft Visual Studio versions as recent as Visual Studio 2013?

0 Kudos
Steven_L_Intel1
Employee
1,463 Views

Yes, Microsoft Fortran PowerStation, used in Developer Studio 4, was a Fortran 90 compiler.

0 Kudos
Reply