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 

Variable corrupted in library

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



Joined: 02 May 2006
Posts: 25

PostPosted: Tue May 23, 2006 8:41 am    Post subject: Variable corrupted in library Reply with quote

We have a strange problem where a variable is corrupted that we think may be a compiler error. Below is a section of code, in which an array element is written out before and after a call to the routine POSEQM.

WRITE(57,5050)CURFIL(1)
5050 FORMAT('DFTSTB 5050, CURFIL= ',A12)
CALL POSEQM('OPEN',0,0,IERR)
WRITE(57,5052)CURFIL(1)
5052 FORMAT('DFTSTB 5052, CURFIL= ',A12)

The output from these two write statements is

DFTSTB 5050, CURFIL= abT0072.RES
DFTSTB 5052, CURFIL=

On the 2nd line the string 'abT0072.RES' is replaced with null characters, but this editor will not copy them. This should not happen.

The routine POSEQM is listed below.

SUBROUTINE POSEQM(CFUNC,ICOMB,ISPEC,IERR)
C----
C CH ARG
C----
CHARACTER *(*) CFUNC
C----
C DATA
C----
DATA ISTEP/1/
CALL POSUPD('EQM',CFUNC,ICOMB,ISPEC,ISTEP,IERR)
RETURN
END

CURFIL is in a common block that is not used in POSEQM. If I add the common block and put a write statement before the call to POSUPD, CURFIL is already corrupted.

C----
C DEBUG OUTPUT
C----
OPEN(60,FILE='POSEQM.DBG')
WRITE(60,5001)CURFIL(1)
5001 FORMAT('POSEQM 5001, CURFIL= ',A12)
CALL POSUPD('EQM',CFUNC,ICOMB,ISPEC,ISTEP,IERR)

The compiler options used are /zeroise /intl /windows, and this only happens when the routines are linked into a library. It is also OK if I use /check, which is why I have used write statements to look at the variables.

As you can probably tell these are all very old FTN77 routines that have been working OK until now. This problem only arose when I tried to build a new version of the program. The new version has some changed routines, but none of those above, and the library has been unchanged for 5 versions, since June last year.

We would appreciate any assistance you can give us tracking down this problem.


Richard May
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue May 23, 2006 12:52 pm    Post subject: Variable corrupted in library Reply with quote

Richard

From the information that you have provided, I cannot tell whether there is a bug in your code or in the compiler.

If you can provide a complete, short working program that illustrates the problem then it should be possible for us to give you a definitive answer.
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