Silverfrost Forums

Welcome to our forums

Possible bug

21 Jun 2025 5:51 #32188

Whenever I try to compile the following subroutine (32bit or 64bit, v9.12.0), I am getting

 subroutine test_regression    ()
 	REAL, ALLOCATABLE	:: AIN(:)

    nk = 1
    	  ALLOCATE(AIN(NK), stat=IST)
	  DEALLOCATE(AIN(NK), stat=IST)
      
end subroutine 

0048d5c4 make_nullify_tree(structÄtree_ptr,enumÄlogical,enumÄlogical) [+01ce] 0048ac84 process_allocate(int,<ref>structÄtree_ptr)#26 [+12ee] 0048cb1c handle_allocate(int,<ptr>char,int) [+06ff] 004111eb parse_executable_statement(<ptr>char,int,<ref>int) [+32a8] 004156d4 handle_token(<ptr>char,int,int,int,int,<ref>int) [+1230] 0040627a ProcessEntireLine(void) [+06c8] 004071fa compile(<ptr>char) [+016f] 0040181d main [+058e]

21 Jun 2025 5:53 #32189

This is my Windows version OS Name: Microsoft Windows 11 Home OS Version: 10.0.26100 N/A Build 26100

22 Jun 2025 6:00 #32190

StamK

Thank you for the bug report which is a regression in FTN95 at v9.12. This has now been fixed for the next release.

22 Jun 2025 8:15 #32191

Would it be possible to have updated EXE/DLLs in the support page? Thanks

22 Jun 2025 8:19 #32192

Yes. As it happened I did that before seeing your request.

22 Jun 2025 4:19 #32194

Confirmed fixed!

26 Aug 2025 7:40 #32303

Compile this 3 line module separately, then comment it out before compiling the main program with /undef.

!ftn95$free
module testmod
    real*8, allocatable :: dshfts(:), deps(:)
end module testmod

    program test
    
    USE testMOD

	    if( allocated(dshfts)) deallocate (dshfts, STAT=IST)
	    if( allocated(deps)) deallocate (deps, STAT=IST)
        
    vnull=-9.9e20
    nkk = 7875
    

    allocate (dshfts(nkk), stat=ist); dshfts=vnull
    allocate (deps(nkk), stat=ist); deps=vnull
    
    WRITE(*,*) 'ok'
    
    end program

make sure that your mod_path is looking in the local folder first

then slink lo objfilename file

sdbg exefilename

if you hover over the 'dshfts' on line 13, what do you see?

if it shows the array as 'REAL*8(subscripts not valid)' then the ALLOCATED test (or the DEALLOCATE) gives an error (usually Access violation) when you step over.

if you uncomment the module code then compile the whole file with /undef and repeat the slink/sdbg, what do you see when you hover over the DSHFTS array:

If it's anything like what I'm seeing, the the hover description is now:

'unassigned [real*8 (Subscripts not valid)]

and the test passes and the program completes OK.

So, my question is:

what is the difference between a MODULE declared in the same source file that it is used in and

a MODULE that is compiled separately from the source code where it is used?

NOTE THAT ONLY SEEMS TO BE A PROBLEM WITH 32-BITS. 64BITS SEEMS TO BE OK?

K

26 Aug 2025 7:38 #32306

I'll have a look at this when I am back from my holiday

27 Aug 2025 6:42 #32307

I think i may have sussed my error.

if you only load the main object file in slink and don't specify to load the module object as well, then it fails at runtime.

if you include loading the module object code, then it all works!

D-oh!

K

Please login to reply.