- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the following code:
program line_test
implicit none
integer :: i, arr(2,5), iv(2)
do i = 1, 5
iv = [i,i]
arr(:,i) = i ! ok statement
arr(:,i) = iv ! ok statement
arr(:,i) = [i,i] ! statenment crashing the code
end do
write(*,*) 'testing succesfull'
end program
It is compiled in debugging mode with the following flags:
/nologo /debug:full /Od /warn:all /module:"x64\Debug\\" /object:"x64\Debug\\" /traceback /check:all /libs:dll /threads /dbglibs /c
When compiled and run using Intel® Fortran Compiler 2024.0 IFORT I get expected results:
x64\Debug\line_test.exe
testing succesfull
When compiled in Debug mode using Intel® Fortran Compiler 2024.0 IFX I get an runtime error:
x64\Debug\line_test.exe
forrtl: severe (408): fort: (11): Subscript #1 of the array ARR has value 0 which is less than the lower bound of 1
Image PC Routine Line Source
line_test.exe 00007FF75E3F15CE LINE_TEST 9 line_test.f90
line_test.exe 00007FF75E3F16FB Unknown Unknown Unknown
line_test.exe 00007FF75E3F1C19 Unknown Unknown Unknown
line_test.exe 00007FF75E3F1B32 Unknown Unknown Unknown
line_test.exe 00007FF75E3F19EE Unknown Unknown Unknown
line_test.exe 00007FF75E3F1C8E Unknown Unknown Unknown
KERNEL32.DLL 00007FF9EF8F257D Unknown Unknown Unknown
ntdll.dll 00007FF9F058AF28 Unknown Unknown Unknown
Code also works fine when compiled in Release mode using Intel® Fortran Compiler 2024.0 IFX compiler with the following flags:
/nologo /O2 /module:"x64\Release\\" /object:"x64\Release\\" /libs:dll /threads /c
Anybody knows why is the code crashing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am pretty sure I posted about a very similar issue not long ago but I am struggling to find it....
[edit: found it]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am pretty sure I posted about a very similar issue not long ago but I am struggling to find it....
[edit: found it]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it does sound like the same issue, with rather unsatisfactory solution of "I escalated this report to our compiler engineering", but without any info about their findings or plans for fixing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Jarek_T
I think your expectations are too high. The bug was reported not so long ago. It's added to the list of bugs that we will fix. Unfortunately, we also have to prioritize on which bugs to work first. Several factors play a role when prioritizing bugs. As you might know, we also offer priority support for those customer who want to have their bugs assigned and worked on with higher priority.
That being said, we are very happy to take up bugs from the community and are very proud of the Fortran community here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are probably right about my expectations. Only recently I started working again with fortran, and the last couple decades I was working with languages where compiler/interpreter errors are super rare and each one is a big deal. I do not recall ever finding one in python, R, C++ or lua and the last one I found in Matlab was probably 15 years ago. So it is a bit jarring to find 2 compiler errors in couple months in IFX compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not finding bugs for decades sound scary to me, smells like a ton of silent bugs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree. Fortran is changing a lot, while trying to be backward-compatible, which sounds like a hard task. I love the new features of the language, which allow creation of much more readable (=maintainable) code, and those will come at the price of bugs.
Thank you all for the help with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Jarek_T - thank you for the report and test case. I have added your test case to the existing internal bug report. There is no fix in the upcoming 2025 release, but we plan on fixing it in future ifx releases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
waiting for the bug fix, you may try using double brackets (it probably depends on the rank of your array):
arr(:,i) = [ [ i,i] ]
It is definitely not a good solution if the problem is repeated in too many lines of your code
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page