ifort (IFORT) 12.1.3 20120212
$ifort -stand f08 bug.f90 -o bug && ./bug
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.