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

Crash when reading into unlimited polymorphic variable

reubendb
Beginner
468 Views

Hello,
The following test program illustrate a crash due to segfault when the program is compiled with Intel Fortran compiler.
[fortran]program UnlimitedPolymorphicRead !-- The following code demonstrate Intel Fortran compiler bug in reading ! to unlimited polymorphic variable character ( 10 ) :: StringValue class ( * ), allocatable :: Value StringValue = '12345' allocate ( integer :: Value ) select type ( Value ) type is ( integer ) !-- The following line crashes with ifort 12.1.2 build 20111128 read ( StringValue, fmt = '(i10)' ) Value print*, 'Integer Value', Value end select end program UnlimitedPolymorphicRead [/fortran] Running the program gives me the following error:

[plain]}$ ifort -V Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.1 Build 20111128 ]$ ifort -g -O0 UnlmtdPolyRead.f90 ]$ gdb ./a.out ... (gdb) run Starting program: ./UnlmtdPolyRead/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000000044de5c in cvt_text_to_integer () (gdb) backtrace #0 0x000000000044de5c in cvt_text_to_integer () #1 0x000000000042df97 in for__cvt_value () #2 0x000000000040827e in for_read_int_fmt_xmit () #3 0x0000000000406ac7 in for_read_int_fmt () #4 0x0000000000402de4 in unlimitedpolymorphicread () at UnlmtdPolyRead.f90:16 #5 0x0000000000402abc in main () [/plain] The same code compiles and runs fine with PGI 12.2 compiler and Cray's compiler, so I believe this is Intel's bug.

Thanks

0 Kudos
2 Replies
Anonymous66
Valued Contributor I
468 Views

We are planing to include a fix for this issue in a future release scheduled for later this year.

0 Kudos
Anonymous66
Valued Contributor I
468 Views
This is issue has been fixed in Intel® Fortran Composer XE for Linux* 2013 which is now available at the Intel® Registration Center. Regards, Annalee Intel Developer Support * Other names and brands may be claimed as the property of others.
0 Kudos
Reply