soccer jersey forums.silverfrost.com :: View topic - MAXVAL with /check-option
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MAXVAL with /check-option

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 9:56 am    Post subject: MAXVAL with /check-option Reply with quote

I got an 'Access-Violation' error with MAXVAL ( or MINVAL) when I compile my code with the /check option (only 64bit). See the following example:
Code:

          program Test_maxval
          integer*4,parameter                :: size_1_of_array = 5
          integer*4,parameter                :: size_2_of_array = 10
          integer*4,parameter                :: max_ref = 10
          real*4                             :: r_maxval
          real*4,ALLOCATABLE,DIMENSION(:,:)  :: real_array
          integer*4                          :: i, ierror
          integer*4,dimension(max_ref)       :: n_points

          ALLOCATE (real_array(size_1_of_array,size_2_of_array),STAT = ierror)
          real_array = 1.
          real_array(2,3) = 2.
          i = 3
          n_points = 4
         
          r_maxval = maxval(real_array(1:4,3))
                   
          write(*,*)'r_maxval=',r_maxval
         
          stop
          end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Wed Feb 28, 2024 10:28 am    Post subject: Reply with quote

Ralf

On first testing this does not fail for me. Which version of FTN95 are you using?
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 10:54 am    Post subject: Reply with quote

Version 9.00.0
I compile the example with:
ftn95 /check /64 testmaxval.f95 /link
Back to top
View user's profile Send private message
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 10:59 am    Post subject: Reply with quote

I am sorry, I posted the wrng version of the example.
relplace the maxval command with:
Code:

          r_maxval = maxval(real_array(1:n_points(i),i))
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Wed Feb 28, 2024 11:27 am    Post subject: Reply with quote

The bounds checking for 64 bits does not work in this context. For the moment it is necessary to add /inhibit_check 20 when using /check.

I will add this to the list of things to investigate.
Back to top
View user's profile Send private message AIM Address
StamK



Joined: 12 Oct 2016
Posts: 162

PostPosted: Wed Jun 12, 2024 2:56 pm    Post subject: Reply with quote

HI, I presume this is not fixed yet? Thanks
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Wed Jun 12, 2024 3:43 pm    Post subject: Reply with quote

That is correct. This is one of about 4 recently reported bugs that have not yet been fixed.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Fri Jun 14, 2024 11:17 am    Post subject: Reply with quote

MINVAL seems to have a similar problem in 64bits...

even if i set the /inhibit_check 20, when i come to run the following line, I get an Access violation trying to access address x0...048 in the MINVAL line.



LE0 = JE0-MIN(JE0,JE1)+1
LE1 = JE1-MIN(JE0,JE1)+1
VVMIN = MINVAL(VDAT(LE0:LE1))
VVMAX = MAXVAL(VDAT(LE0:LE1))

vdat is a 72-element array, LE0=1, LE1=72.

in this example, VDAT contains -9.9x10^20 and above it is the code to check it for valid data.


K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Sat Jun 15, 2024 7:08 am    Post subject: Reply with quote

Kenny

Thanks for the additional information. I will aim to take a took at this next week.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Mon Jun 17, 2024 8:40 am    Post subject: Reply with quote

Ralf

This failure has now been fixed for the next release of FTN95.

Kenny

From the information provided I have not been able to create a sample program that fails. If you are not using the latest release then it is possible that the failure has already been fixed. Otherwise the fix for Ralf is very likely to be the same issue.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group