[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1320.0. "segmentation fault by argument is changed in subroutine" by TKOV60::YAMAGISHI (Chinese whispers) Fri May 30 1997 04:03

Hello,

When my customer upgraded Digital Fortran for Digital UNIX from V3.8 to V4.1,
Some program could not be executed which subroutine statement argument is
changeg in it.
The following list is a part of program can not be executed. The program is
stopped at '<---' by 'Segmentation fault'.
------------------------------------------------------------------------
			:
			:
			:
              WRITE(NFOUT,*) ' FCC LATTICE '
              CALL FCCM
     >         (KNV3,NKX,SPINP,NFOUT,
     <          KV3,VX,VY,VZ,QWGT,INDX)
			:
			:
			:
      SUBROUTINE FCCM
     >     (MAXDIM,NKX,SPINP,NFOUT,
     <      NKTOT,VX,VY,VZ,QWGT,INDX)
C     GENERATION OF MESHES IN B.Z. FOR LAT=1
      IMPLICIT REAL(A-H,O-Z)
      INTEGER  MAXDIM,NKX,INDX(0:20,0:20,0:20),NFOUT
      REAL   VX(MAXDIM),VY(MAXDIM),VZ(MAXDIM),QWGT(MAXDIM),Q(3),QW
      LOGICAL SPINP
      NKXH=NKX/2
      NKXQ=NKXH/2
      NKXH=NKXQ+NKXQ
      NKX=NKXH+NKXH		<--- (Segmentation fault)
      NKXH3=NKXH+NKXH+NKXH
      NKXQ3=NKXQ+NKXQ+NKXQ
			:
			:
			:
------------------------------------------------------------------------
The program which compiled by DFA380 can be executed at machine installed
DFA400 or DFA410; And, compiled by DFA400 or DFA410 can not be executed at
DFA380.

Please get the program from following anonymous ftp site and try it.

	tjou06.tjo.dec.com:~ftp/pub/fortran/fortran_note.tar.gz
	(16.159.144.25)

Thanks in advance,
							Satoshi Yamagishi
							DEC Japan
T.RTitleUserPersonal
Name
DateLines
1320.1NKX is a parameterHERON::BLOMBERGTrapped inside the universeFri May 30 1997 08:0526
    
            As you say, the problem happens at the line
    
            NKX=NKXH+NKXH in the routine FCCM. FCCM is called
    	    from KSTEP, which is called from higer up:
    
    
                      CALL KSTEP
         >     (KNV3,KBZTYP,ALTV,RLTV,
         >      KNVX,KNVY,KNVZ,KNVX2,KNVY2,KNVZ2,6,
         <      KV3,VX,VY,VZ,QWGT)
    
                  SUBROUTINE KSTEP
         >     (KNV3,NBZTYP,ALTV,RLTV,NKX,NKY,NKZ,NKX2,NKY2,NKZ2,NFOUT,
         <      KV3,VX,VY,VZ,QWGT)
     
            As can be seen NKX corresponds to KNVX. But KNVX is defined
            in PACVPP:
    
            PARAMETER(KNVX=8,KNVY=8,KNVZ=8)
    
            It's a parameter. That's why you can't change it like
            a variable. I don't understand if this has worked before.
    
    /Ake 
    
1320.2WIBBIN::NOYCEPulling weeds, pickin&#039; stonesFri May 30 1997 12:545
> I don't understand if this has worked before.

Older versions of Digital Fortran on UNIX weren't able to
use read-only storage to help catch this user error.
(The result was that the value of 8 could be changed...)