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 

FTN95 8.10 false error report: Array arg w too few elements

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Tue Feb 13, 2018 1:54 pm    Post subject: FTN95 8.10 false error report: Array arg w too few elements Reply with quote

The following test program has no errors (tested with other compilers with checks on), and runs fine when compiled using FTN95 8.10 without /check. When /check is specified, it aborts with the error
Quote:
Attempt to call a routine with argument number two containing too few array elements

Here is the program source, with the call chain marked with comments. The error occurs in 32- as well as 64-bit modes.

Code:
program xfixpqs
   implicit none
   integer, parameter :: n = 5
   integer :: y(n)
   y(1:n-1) = 7
   call fixpqs(n, y)                       !start of call chain
   print '(5I4)',y
   stop
contains
   subroutine fixpqs(n, y)
      implicit none
      integer, intent (in) :: n
      integer, dimension (:), intent (inout) :: y
      integer, allocatable, dimension (:) :: yp, yold, ypold
      allocate (yold(n), yp(n), ypold(n))
      ypold(1:n-1) = 3
      ypold(n) = 1
      y(n) = 0
      call tangns(yp, ypold, n)             ! second link of call chain
      y(2) = yp(1)
      deallocate(yp,yold,ypold)
      return

   end subroutine fixpqs
!
   subroutine tangns(yp, ypold, n)
      implicit none
      integer, intent (in), dimension (:) :: ypold
      integer, intent (out), dimension (:) :: yp
      integer, intent (in) :: n
      yp = ypold
      call pcgds(n, yp)                     ! third link of call chain
      return
   end subroutine tangns
!
   subroutine pcgds(nn, start)
      implicit none
      integer, intent (in) :: nn
      integer, intent (inout) :: start(nn)
      start(nn) = start(nn)+3                ! aborts on this line
      return
   end subroutine pcgds

end program xfixpqs


NOTE: I suspect that the problem reported by DanRRight in http://forums.silverfrost.com/viewtopic.php?t=3690 may be another instance of the same (or, at least, related) bug. If so, we can see that we do not need subroutines with 1189 arguments (or even 31) to run into this bug.

A similar problem that I reported a week ago ( http://forums.silverfrost.com/viewtopic.php?t=3682 ) may be another version of the same. That problem was encountered when using the MINPACK package, whereas the present report is about a problem with using the HOMPACK90 package. The test program given here is shorter and involves only integer variables.

---
Incidentally, this test code caused me to notice some quirks of the traceback popup, SDBG and SDBG64.

In 32-bit mode, I see the following error pop-up (comments added to some lines):
Code:
Run-time Error
Attempt to call a routine with argument number two containing too few array elements

 XFIXPQS~PCGDS -  in file jfixpqs.f90 at line 34 [+006d]   ==>> ??? wrong line number
 XFIXPQS~TANGNS -  in file jfixpqs.f90 at line 32 [+00fb]
 XFIXPQS~FIXPQS -  in file jfixpqs.f90 at line 19 [+0254]
 XFIXPQS -  in file jfixpqs.f90 at line 6 [+006f]

Line 34 is not even executable. When I run this inside SDBG, the stack trace shows only three links, stopping on line 32.

In 64-bit mode, the error pop-up shows:
Code:
Attempt to call a routine with argument number two containing too few array elements at address 1c008159

Within file ifixpqs.exe
in XFIXPQS~PCGDS at address 14a                ==>> Missing line number; shown as 40 in SDBG64
in XFIXPQS~TANGNS in line 32, at address 25c
in XFIXPQS~FIXPQS in line 19, at address 5ads
in XFIXPQS in line 6, at address 9d

When I run inside SDBG64, the formerly missing line number is shown as 40 -- quite reasonable, that is the first executable statement in sub
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 13, 2018 6:11 pm    Post subject: Reply with quote

mecej4

Many thanks for the feedback.
This issue has now been fixed for the next release.
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 -> Support 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