Runtime bug involving unlimited polymorphic type.

Runtime bug involving unlimited polymorphic type.

$ifort --version
ifort (IFORT) 12.1.3 20120212

$ifort -stand f08 bug.f90 -o bug && ./bug
results in:

 key=[z]FOR_DUMP_EXCEPTION_INFOfor_init.cLinux Dump of siginfo struc t: Dump of ucontext struct: FOR_IGNORE_EXCEPTIONSsegmentation fault oc curred2@2@] key=[z] 

contents of bug.f90:

program bug character(len=200) :: name call s1(val = name, key = "z") call s2(val = name, key = "z") contains subroutine s1(val, key) class(*) :: val character(len=*) :: key print *, "key=["//trim(key)//"]" end subroutine s1 subroutine s2(key, val) class(*) :: val character(len=*) :: key print *, "key=["//trim(key)//"]" end subroutine s2 end program bug 

Increasing the length of 'name' results in revealing further parts of what seems to be a binary file, Strangely it seems that the order of arguments in a function definition matters, because s2 runs with no problems. I will use it as a temporary solution. Also if name is of type integer or real the strange behavior is not manifested.

publicaciones de 4 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

How very amusing. It probably relates to the string length hidden argument. Thanks - I will report this to the developers. Issue ID is DPD200180999.

Steve

This bug is fixed for a release later this year.

Steve

The bug was fixed in the 13.0 compiler.

Steve

Inicie sesión para dejar un comentario.