Backtrace For This Error #0
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and backtrace for this error segmentation fault 11 policies of this site About Us Learn more about Stack Overflow the
Backtrace For This Error Fortran
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Fortran Segmentation Fault Invalid Memory Reference
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Fortran Segmentation Fault (core Dumped)
takes a minute: Sign up “Segmentation Fault (core dumped)” error in Fortran gfortran linux up vote 0 down vote favorite I am creating a program which will analyse a file .fits in a directory and then it will create another file .txt in another directory. It is just a converter. When I tried to execute the program (compiling is OK) it gfortran segmentation fault gives me an error message: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: 0 0x7FC5ADB1C117 1 0x7FC5ADB1C6F4 2 0x7FC5AD46C0AF 3 0x44E704 in ffthdu at fitscore.c:6893 4 0x405101 in MAIN__ at Codigo.f90:? Segmentation fault (core dumped) And there is another information: when I delete a stretch of the program which does the "write to the new .txt converter file" part, the program goes OK and it reads the entire .fits file! Here is this stretch: arq='spec-1.txt' open (29,file=arq,status='unknown') write(29,*) ' l(n) fa(n)' do n=1,naxes write(29,*) l(n), fa(n) end do I have declared the variable "arq" as a character and everything is OK. When I delete this stretch the segmentation fault does not appear any more, but I do not know what to do now because I need to pass the information to this .txt! And the "arq" string is not complete because I am just testing now, later I will add the entire directory. And here is the full program, I am using "gfortran Codigo.f90 -o TESTE -Lcfitsio -lcfitsio" to compile it: implicit none integer largo,
here for a quick overview of the site Help Center Detailed invalid memory reference hspice answers to any questions you might have Meta Discuss segmentation fault in fortran 90 the workings and policies of this site About Us Learn more about Stack Overflow the segmentation fault 11 fortran company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss http://stackoverflow.com/questions/20453315/segmentation-fault-core-dumped-error-in-fortran-gfortran-linux Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up what is “segmentation fault - invalid memory reference error” in FORTRAN up vote -2 down vote favorite I am receiving http://stackoverflow.com/questions/31257222/what-is-segmentation-fault-invalid-memory-reference-error-in-fortran the following error in my Fortran code : Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7F80C7B46777 #1 0x7F80C7B46D7E #2 0x7F80C7282D3F #3 0x402D1A in __mymodule_MOD_gcr_mfree #4 0x412175 in MAIN__ at HUHSI1.f90:? Segmentation fault (core dumped) ------------------ (program exited with code: 139) I don't understand this error completely. What is this error? Number 3 indicates the following subroutine : SUBROUTINE gcr_Mfree(F2,Cnew,Cold,C_Fold,xm,converged) !**** FUNCTIONS TO BE SOLVED **** ! Generalized Conjugate Residual Algorithm ! Solves M*x=b (J*dx=-F) IMPLICIT REAL*8 (A-H,O-Z) INTEGER, intent(out) :: converged REAL*8, DIMENSION(:,:), ALLOCATABLE :: F2,p,Mp REAL*8, DIMENSION(:), ALLOCATABLE :: F2V,F22V,CnewV,ColdV,C_FoldV,alpha2,r,b,Mr,xv ! 2D INPUT VARIABLE DIMENSIONS: DIMENSION F22(-2:IG+2,-2:JG+2) DIMENSION Cnew(-2:IG+2,-2:JG+2) DIMENSION Cold(-2:IG+2,-2:JG+2) DIMENSION C_Fold(-2:IG+2,-2:JG+2) DIMENSION xm(-2:IG+2,-2:JG+2) integer :: j,maxiter,iter real*8 :: tol,normr !=================================================================== MASK = SIZE(F2) ! Size of F2 : (IG+5)*(JG+5) Print*, 'MASK IS EQUAL TO',MASK ALLOCATE(F2V(1:MASK)) ALLOCATE(CnewV(1:MASK)) ALLOCATE(ColdV(1:MASK)) ALLOCATE(C_FoldV(1:MASK)) ALLOCATE(xv(1:MASK)) ALLOCATE(r(1:MASK)) ALLOCATE(b(1:MASK)) ALLOCATE(p(1:IG,1:JG)) ALLOCATE(Mp(1:IG
team • Delete all board cookies • All times are UTC - 5 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Forgot Password Login: [x] User account creation filtered due to spam. Bug54784 - [4.7/4.8 Regression] [OOP] wrong code in polymorphic allocation with SOURCE Summary: [4.7/4.8 Regression] [OOP] wrong code in polymorphic allocation with SOURCE Status: RESOLVED FIXED Alias: None Product: gcc Classification: Unclassified Component: fortran (show other bugs) Version: 4.8.0 Importance: P3 normal Target Milestone: --- Assignee: janus URL: Keywords: wrong-code Duplicates (1): 54874 (view as bug list) Depends on: Blocks: Reported: 2012-10-02 20:07 UTC by Jeremy Kozdon Modified: 2012-10-14 22:27 UTC (History) CC List: 2 users (show) janus sfilippone See Also: Host: Target: Build: Known to work: Known to fail: Last reconfirmed: 2012-10-02 00:00:00 Attachments Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Jeremy Kozdon 2012-10-02 20:07:38 UTC (Error also occurs with gcc 4.7.1) When I have a container module with stores a collection of polymorphics types, I sometimes get an error that a pointer is being freed which was not allocated. An example program is below. It can be compiled without errors gfortran bug.f90 It contains four modules each with an associated type. If the type 'block' in 'block_module' the member nFields is commented out the code runs fine. If a print statement is added in the program the code runs fine If the dimension of the member 'x' of types block_cart1d and block_cart2d are changed so that they are not 3 and 4 (only one must be changed), the program works. Finally, if the order in the program of the addBlock command is reversed the bug.f90 -------- module block_module implicit none private public :: block type,abstract :: block ! if commented out code works fine integer ,private :: nFields = 0 end type block end module block_modu