Crash when reading into unlimited polymorphic variable

Crash when reading into unlimited polymorphic variable

Hello,
The following test program illustrate a crash due to segfault when the program is compiled with Intel Fortran compiler.

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 
Running the program gives me the following error:

}$ 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 () 
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

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today