View previous topic :: View next topic |
Author |
Message |
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 9:56 am Post subject: MAXVAL with /check-option |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Feb 28, 2024 10:28 am Post subject: |
|
|
Ralf
On first testing this does not fail for me. Which version of FTN95 are you using? |
|
Back to top |
|
|
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 10:54 am Post subject: |
|
|
Version 9.00.0
I compile the example with:
ftn95 /check /64 testmaxval.f95 /link |
|
Back to top |
|
|
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 10:59 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Feb 28, 2024 11:27 am Post subject: |
|
|
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 |
|
|
StamK
Joined: 12 Oct 2016 Posts: 162
|
Posted: Wed Jun 12, 2024 2:56 pm Post subject: |
|
|
HI, I presume this is not fixed yet? Thanks |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Jun 12, 2024 3:43 pm Post subject: |
|
|
That is correct. This is one of about 4 recently reported bugs that have not yet been fixed. |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Fri Jun 14, 2024 11:17 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Sat Jun 15, 2024 7:08 am Post subject: |
|
|
Kenny
Thanks for the additional information. I will aim to take a took at this next week. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Mon Jun 17, 2024 8:40 am Post subject: |
|
|
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 |
|
|
|