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 

undef test on a read from a probably corrupted file

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



Joined: 02 Aug 2005
Posts: 317

PostPosted: Thu Sep 07, 2023 9:32 am    Post subject: undef test on a read from a probably corrupted file Reply with quote

hi,

i have the following block of code that i was unable to use /UNDEF on under ftn32 (because of the negative address problem) but i can use /UNDEF under ftn64:

Code:
   IF( IREV.GE.462 ) THEN
      AZ%CHSOU(:) =  ICHSOU(43:72)
      AZ%CHFX(:)  = ICHSOUF(43:72)
     READ (NU, IOSTAT=IOS)  AZ%CHSOU(43:72), AZ%CHFX(43:72)
     IF( IOS.GT.0  ) THEN
       IF( IREV.EQ.462 ) THEN
         BACKSPACE (NU)
          AZ%CHSOU(:) =  ICHSOU(43:72)
          AZ%CHFX(:)  = ICHSOUF(43:72)
        ELSE
          GO TO 98 
       END IF 
     END IF   
   END IF


and I get an IOSTAT=158 (which indicates that there aren't enough values stored in the file being read at that record which I happen to know is because the record wasn't written originally) but before the test gets used that invokes the "backspace" command, i get an "UNDEFINED Variable/function" error under the 64-bit debugger on the READ statement.

I can examine all the variables involved and none of them are "UNDEFINED", so i can only assume that the UNDEFINED values are in the internal READ function.

I imagine that, as the "inline" !FTN95OPTIONS command isn't functioning under FTN64, i will have to split the source file and compile that particular routine without /UNDEF?

But, i wonder if there's some other "sneaky" way for treating UNDEFINED values as 0 (or some other specific value) when they are encountered during a READ (or other internal function)?

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


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

PostPosted: Thu Sep 07, 2023 12:49 pm    Post subject: Reply with quote

Kenny

I would need more information before I could comment on this.

Can you construct and post a short program that runs and illustrates the problem?
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Thu Sep 07, 2023 12:55 pm    Post subject: Reply with quote

not easily. It only happens with a specific datafile. I can try to isolate the particular subroutine and see if that fails with a "wrapper" opening the datafile but it may require lots of module for it to successfully link...

I'll let you know...

K
Back to top
View user's profile Send private message Visit poster's website
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Thu Sep 07, 2023 5:45 pm    Post subject: Reply with quote

ok, i've sent you a zip file via "hightail".

just unzip to a new folder and

sdbg64 new1

it should crash at the relevant point...

k
Back to top
View user's profile Send private message Visit poster's website
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Thu Sep 07, 2023 6:43 pm    Post subject: on a similar but unrelated subject Reply with quote

should this code work under /undef?

INTEGER(KIND=7) :: I7=0
INTEGER*4 IKINDSIZE

INQUIRE(IOLENGTH=IKINDSIZE) I7

it returns 4 or 8 into IKINDSIZE under normal usage but claims that I'm trying to call a subroutine as a function(or vice versa) in the debugger on the INQUIRE line...

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


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

PostPosted: Sat Sep 09, 2023 7:09 am    Post subject: Reply with quote

Kenny

I have logged the first issue for investigation.

I have not been able to reproduce the problem with INQUIRE and I am assuming that it has already been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 11, 2023 8:35 am    Post subject: Reply with quote

Kenny

The problem with INQUIRE may have been fixed in the interim downloads provided here... http://forums.silverfrost.com/viewtopic.php?t=4245.
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