Re: Run-time error with gfortran -fbounds-check



ok, I found something interesting: I have another segmentation fault
with a modified version of the same code compiled with gfortran 4.2.2,
which now occurs when testing a logical variable during the sixth call
of a subroutine:

141 IF(efield) then
(gdb) print efield
$8 = @0x3cb7fc4ea1b4ca47: Cannot access memory at address
0x3cb7fc4ea1b4ca47

Doesn't it look like a memory leak?

All the code is static, except one subroutine, where I have declared:

COMPLEX(KIND=8), ALLOCATABLE, DIMENSION(:) :: ksigma_ommu,alpha,r
.../..
ALLOCATE(ksigma_ommu(0:nl1),alpha(0:nl1),r(0:nl))
.../..
DEALLOCATE(ksigma_ommu,alpha,r)


nl and nl1 are well-defined integers, and these arrays are passed to
subroutines in which arguments are declared with statements like

COMPLEX(KIND=8), INTENT(OUT), DIMENSION(0:) :: ALPHA

But even when I replace the allocatable arrays by static ones, the
program still terminates with a segmentation fault! Is there anything
else which could cause memory problems besides allocatable arrays?

.



Relevant Pages

  • Re: Large matrix in subroutine?
    ... subroutine A ... Explicit shape arrays, e.g., Testreserve the declared amount of memory regardless of whether the array is ever used. ... allocatable arrays conume memory only when an Allocate statement is executed. ... Since almost all modern Fortran compilers have implemented the Fortran 2003 Allocatable Extensions, they no longer have the restrictions on the use of allocatable arrays that used to exist. ...
    (comp.lang.fortran)
  • Re: VIA C7 / VIA PC-1 (PC2500) anyone?
    ... Segmentation fault ... on compiling aic79xx_core.c file in kernel, ... It's definitely NOT memory issue - I tried several different ... -- just random applications are ...
    (Linux-Kernel)
  • Re: seg fault and I dont know where
    ... the program terminates with a segmentation fault. ... > because of an out of bounds error or anything. ... > freed all the memory. ... cause a program to crash. ...
    (comp.lang.c)
  • Re: A basic C question about segmentation fault
    ... This program terminate just after one loop while the second program ... goes on infinitely untill segmentation fault on gcc. ... I partially understand that in the second program the stack becomes ... "improper memory handling": ...
    (comp.lang.c)
  • VIA C7 / VIA PC-1 (PC2500) anyone?
    ... fanless, -- it becomes a almost real PC (1500MHz CPU), ... Segmentation fault ... It's definitely NOT memory issue - I tried several different ... -- just random applications are ...
    (Linux-Kernel)