I have been working on a groundwater flow program with about 12,000 lines of Fortran code. FTN95 (V 8.71) has been quite helpful in finding and fixing bugs related to subscript bounds, uninitialised variables, etc. However, in one run, I encountered strange program behaviour.
When I compiled the program with /checkmate and built a 32-bit EXE, the program ran for a few seconds and then aborted with INTEGER OVERFLOW on a line that contains just a subroutine call:
call abmult(Ap(1,l),Bp(:,l))
When I compiled the same program with /64 /checkmate to build a 64-bit EXE, the behaviour becomes a bit stranger. When I ran the EXE from the command line, the small Windows hourglass icon came on. After up to ten seconds, the program quit with no messages of any kind. When I ran the same EXE from SDBG64, execution stopped after about one second, reporting:
Error: Access Violation writing address 0x000000000AC40000
The line of code on which this happens is just a line containing an argument variable declaration, and reads:
real(kind=KDP) , dimension(*) , intent(out) :: X
[Added on 16 April] Looking at the assembler code in the area where the access violation occurs reveals that an attempt is made to store the marker byte value Z'80' (= 'undefined') into Z'653BFFFF3588' bytes of memory starting at address Z'0AC40000' . That byte count is too large to be represented in 32 bits, which may explain the integer overflow encountered by the 32-bit EXE.
I have created a reproducer by removing about 50 percent of the code, but the reproducer is still a bit large -- about 6,000 lines. The source code, a required input data file, and batch files for building EXEs from the sources are contained in a Zip file which may be downloaded from Dropbox:
https://www.dropbox.com/s/az2yedspwjk5unk/asizbug.7z?dl=0