- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following program gives a segfault with Intel 15.0.2 on Linux:
PROGRAM read_empty_substing CHARACTER(LEN=20) :: c_in = "hello" CHARACTER(LEN=20) :: c_out INTEGER :: i_iostat ! These statements give a segfault with Intel 15.0.2 READ(c_in(2:1), '(A)') c_out READ(c_in(2:1), '(A)', IOSTAT=i_iostat) c_out ! The following statements give end-of-file as expected: !READ(c_in(2:1), *) c_out !READ(c_in(2:1), *, IOSTAT=i_iostat) c_out print *, TRIM(c_out) END PROGRAM
As you can see, we try to read from an empty substring of c_in, and I do expect an error condition, i.e. i_iostat/=0. Instead I get a segfault. The read statements with format string segfaults, while the list directed read gives end-of-file. Am I supposed to check the length of the internal file before I read from it, or could this be a compiler bug?
Øyvind
------------------------
(gdb) run Starting program: /fs/auto/home/oyvindj/tmp/read_segfault/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Catchpoint -2 (signal SIGSEGV), 0x00000000004804c6 in __intel_ssse3_rep_memcpy () (gdb) bt #0 0x00000000004804c6 in __intel_ssse3_rep_memcpy () #1 0x0000000000409546 in for_read_int_fmt_xmit () #2 0x000000000040783f in for_read_int_fmt () #3 0x0000000000402e01 in read_empty_substing () at read.f90:7 #4 0x0000000000402d5e in main ()
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is our bug - I'll let the developers know. Thanks. Issue ID is DPD200369590.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is our bug - I'll let the developers know. Thanks. Issue ID is DPD200369590.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this bug to be fixed in the 16.0 release.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page